The importable AIQ EDS file based on Markos Katsanos’ article in the April issue of Stocks & Commodities, “Detecting High-Volume Breakouts,” can be obtained on request via email to info@TradersEdgeSystems.com.

Excerpt “Is there anything more satisfying for a trader than capturing a huge breakout? The usual practice for breakout entries is to simply buy new highs. This method, when used in isolation, will often result in false breakouts. It is, therefore, better to wait for volume confirmation before entering the trade, as high-volume breakouts usually last much longer. In this article, I will show you how to detect breakouts using only volume, sometimes even before price breaks out, by introducing a new volume breakout indicator. “

The code is also available here:

!Detecting High-Volume Breakouts !Author: Markos Katsanos, TASC April 2021 !Coded by: Richard Denning, 02/18/2021 !INPUTS: period is 30. smoLen is 3. vpnCrit is 10. maLen is 30. V is [volume].

!FORMULAS: MAVol is simpleavg(V,period). MAV is iff(MAVol>0,MAVol,1). Avg is ([High]+[Low]+[Close])/3. MF is Avg - valresult(Avg,1). ATR is simpleavg(max( [high]-[low],max(val([close],1)-[low],[high]-val([close],1))),period). MC is 0.1*ATR. VMP is iff(MF > MC, V, 0). VP is sum(VMP,period). VMN is iff(MF < -MC, V, 0). VN is sum(VMN,period). VPN is (expavg(((VP - VN) / MAV / period),smoLen))*100. MAVPN is simpleavg(VPN,maLen).

Code for the VPN indicator is set up in the AIQ code file. Figure 9 shows the indicator on a chart of Tesla Motors Inc (TSLA).

FIGURE 9: AIQ. The VPN indicator is shown on a chart of Tesla Motors Inc. (TSLA).

Relative strength has more information embedded within it than meets the eye. Here is a way to identify and compress several dimensions of relative strength into one single scalable value, the RS4r, which allows you to compare and then rank securities for robustness across timeframes and shifting market conditions…

The importable AIQ EDS file based on James Garofallou’s article in Stocks & Commodities magazine September 2020 issue, “The RS4r: Tracking Relative Strength In Four Dimensions,” can be obtained on request via email to info@TradersEdgeSystems.com. The code is also available here:

! The RS4r: Tracking Relative Strength in Four Dimensions
! Author: James Garofallou, PhD, TASC Sept 2020
! Coded by: Richard Denning, 7/18/2020
!INPUTS
C is [close].
len1 is 10.
len2 is 15.
NumIndx is 4.
BuyLvl is 80.
!FORMULAS
SPYc is TickerUDF("SPY",C). !SP500
QQQc is TickerUDF("QQQ",C). !NASDAQ100
MDYc is TickerUDF("MDY",C). !SP400
IWMc is TickerUDF("IWM",C). !Russel2000
RS1spy is C/SPYc.
RS1qqq is C/QQQc.
RS1mdy is C/MDYc.
RS1iwm is C/IWMc.
FastSPY is Expavg(RS1spy,len1).
MedSPY is Simpleavg(FastSPY,7).
SlowSPY is Simpleavg(FastSPY,15).
VSlowSPY is Simpleavg(SlowSPY,30).
FastQQQ is Expavg(RS1qqq,Len1).
MedQQQ is Simpleavg(FastQQQ,7).
SlowQQQ is Simpleavg(FastQQQ,15).
VSlowQQQ is Simpleavg(SlowQQQ,30).
FastMDY is Expavg(RS1mdy,Len1).
MedMDY is Simpleavg(FastMDY,7).
SlowMDY is Simpleavg(FastMDY,15).
VSlowMDY is Simpleavg(SlowMDY,30).
FastIWM is Expavg(RS1iwm,Len1).
MedIWM is Simpleavg(FastIWM,7).
SlowIWM is Simpleavg(FastIWM,15).
VSlowIWM is Simpleavg(SlowIWM,30).
Tier1spy is iff(FastSPY>=MedSPY and MedSPY>=SlowSPY and SlowSPY>=VslowSPY,10,0).
Tier1qqq is iff(FastQQQ>=MedQQQ and MedQQQ>=SlowQQQ and SlowQQQ>=VslowQQQ,10,0).
Tier1mdy is iff(FastMDY>=MedMDY and MedMDY>=SlowMDY and SlowMDY>=VslowMDY,10,0).
Tier1iwm is iff(FastIWM>=MedIWM and MedIWM>=SlowIWM and SlowIWM>=VslowIWM,10,0).
Tier2spy is iff(FastSPY>=MedSPY and MedSPY>=SlowSPY and SlowSPY<VslowSPY,9,0).
Tier2qqq is iff(FastQQQ>=MedQQQ and MedQQQ>=SlowQQQ and SlowQQQ<VslowQQQ,9,0).
Tier2mdy is iff(FastMDY>=MedMDY and MedMDY>=SlowMDY and SlowMDY<VslowMDY,9,0).
Tier2iwm is iff(FastIWM>=MedIWM and MedIWM>=SlowIWM and SlowIWM<VslowIWM,9,0).
Tier3spy is iff(FastSPY<MedSPY and MedSPY>=SlowSPY and SlowSPY>=VslowSPY,9,0).
Tier3qqq is iff(FastQQQ<MedQQQ and MedQQQ>=SlowQQQ and SlowQQQ>=VslowQQQ,9,0).
Tier3mdy is iff(FastMDY<MedMDY and MedMDY>=SlowMDY and SlowMDY>=VslowMDY,9,0).
Tier3iwm is iff(FastIWM<MedIWM and MedIWM>=SlowIWM and SlowIWM>=VslowIWM,9,0).
Tier4spy is iff(FastSPY<MedSPY and MedSPY>=SlowSPY and SlowSPY<VslowSPY,5,0).
Tier4qqq is iff(FastQQQ<MedQQQ and MedQQQ>=SlowQQQ and SlowQQQ<VslowQQQ,5,0).
Tier4mdy is iff(FastMDY<MedMDY and MedMDY>=SlowMDY and SlowMDY<VslowMDY,5,0).
Tier4iwm is iff(FastIWM<MedIWM and MedIWM>=SlowIWM and SlowIWM<VslowIWM,5,0).
RS2spy is Tier1spy + Tier2spy + Tier3spy + Tier4spy.
RS2qqq is Tier1qqq + Tier2qqq + Tier3qqq + Tier4qqq.
RS2mdy is Tier1mdy + Tier2mdy + Tier3mdy + Tier4mdy.
RS2iwm is Tier1iwm + Tier2iwm + Tier3iwm + Tier4iwm.
RS3x is (RS2spy+RS2qqq+RS2mdy+RS2iwm).
RS4 is (RS3x/NumIndx)*10.
RS4osc is simpleavg(RS4,3).
mvSig is simpleavg(RS4osc,5).
RS4r is round(RS4).
mvRS4 is expavg(RS4r,4).
RS4up is iff(RS4r >= 80 or RS4r > mvRS4,1,0).
X is iff(RS4 >= 80,1,0).
R5 is iff(RS4up =1,round(simpleavg(X,len2)*100),0).
Buy if R5 >= BuyLvl.
ExitBuy if R5 < BuyLvl.
ShowValues if 1.

Code for the RS4r is included in the EDS file. I also coded a system that uses the RS4r (R5). I used four independent ETFs as indexes rather than the 11 mutual funds that the author used. I used SPY, QQQQ, MDY, and IWM. The trading system buys (long only) when the R5 >= 80 and exits the long position when RS4r < 80. The summary EDS backtest report for trading this system on the Nasdaq 100 stocks (commission & slippage not subtracted) is shown in Figure 13 and a sample trade on DISH with the R5 indicator is shown in Figure 12.

FIGURE 12: AIQ. Chart of DISH with R5 indicator and sample trade using R5 indicator >= 80 to buy.

FIGURE 13: AIQ. Summary EDS backtest report for the R5 system that trades the Nasdaq 100 stocks over the last 4 years.

The importable AIQ EDS file based on Vitali Apirine’s article in the August, 2020 issue of Stocks & Commodities magazine, “The Compare Price Momentum Oscillator (CPMO),” can be obtained on request via email to info@TradersEdgeSystems.com.

… Here is a way you can compare at a glance the momentum of two different market indexes or securities in the same chart. It could also be used to help generate trading signals. In this first part of a three-part series, we’ll look at comparing index momentums…

The code is also available here:

!Author: Vitali Aprine, TASC August 2020
!Coded by: Richard Denning, 6/20/20
!www.TradersEdgeSystems.com

!Custom smoothing multiplier: 2 / time period
!PMO line: 20-period custom EMA of (10 × 35-period
!custom EMA of ((Today’s price – Yesterday’s price) /
!Yesterday’s price × 100))
!PMO signal line: 10-period EMA of the PMO line

Len1 is 20.
Len2 is 35.
Len3 is 10.
Ticker1 is “QQQ”.
Ticker2 is “SPY”.

C is [close].
C1 is valresult(C,1).
RC1 is (C/C1*100)-100.

custSmoLen1 is Len1 – 1.
custSmoLen2 is Len2 – 1.

CustEma is 10*expavg(RC1,custSmoLen2).
PMO is expavg(CustEma,custSmoLen1).
PMOsig is expavg(PMO,Len3).

Ticker1C is tickerUDF(Ticker1,C).
RC1ticker1 is (Ticker1C/valresult(Ticker1C,1)*100)-100.
CustEmaTicker1 is 10*expavg(RC1ticker1,custSmoLen2).
PMOticker1 is expavg(CustEmaTicker1,custSmoLen1).

Ticker2C is tickerUDF(Ticker2,C).
RC1ticker2 is (Ticker2C/valresult(Ticker2C,1)*100)-100.
CustEmaTicker2 is 10*expavg(RC1ticker2,custSmoLen2).
PMOticker2 is expavg(CustEmaTicker2,custSmoLen1).

CPMO is PMOTicker1 – PMOTicker2.
List if hasdatafor(1000) >= 900.

I coded the indicator described by the author. Figure 10 shows the indicator (QQQ,SPY,20,35) on chart of IWM. When the white line is above the red line on the CPMO indicator, this indicates that the QQQ is stronger than the SPY. Generally, it is considered bullish when the QQQ is leading in strength.

FIGURE 10: AIQ. The CPMO indicator is shown on a chart of IWM with parameters (QQQ,SPY,20,35).

In “A Simple Way To Trade Seasonality” in the September 2019 Stocks & Commodities, author Perry Kaufman describes methods he uses for measuring the seasonality in markets and approaches he uses for trading these patterns

Editors note: The full article can be obtained from Stocks & Commodities magazine at http://technical.traders.com/sub/sublog2.asp#Sep the system rules are from the article and are based on these rules

1. Average the monthly frequency of the past 4 years.

2. Find the last occurrence of the highest frequency and the last occurrence of the lowest frequency using the average frequency in step 1. That is, if both March and April have a frequency of 70, we use April.

3. Only trade if the high frequency is 75% or greater and the low frequency is 25% or lower.

4. If the high frequency comes first, sell short at the end of the month with the high frequency. Cover the short at the end of the month with the low frequency.

5. If the low frequency comes first, buy at the end of the month with the low frequency. Sell to exit at the end of the month with the high frequency

The importable AIQ EDS file and Excel spreadsheet for Perry Kaufman’s article can be obtained on request via email to info@TradersEdgeSystems.com. The code is also shown below

!A Simple Way to Trade Seasonality
!Author: Perry Kaufman, TASC September 2019
!Coded by: Richard Denning, 07/21/2019
!www.TradersEdgeSystem.com
C is [close].
year is 2019.
len is 4000.
OSD is offsettodate(month(),day(),year()).
FirstDate is firstdatadate().
EOM1 if Month()=2 and valresult(month(),1)=1 and year()=year.
EOMos1 is scanany(EOM1,len) then OSD+1.
EOMc1 is valresult(C,^EOMos1).
EOM2 if Month()=3 and valresult(month(),1)=2 and year()=year.
EOMos2 is scanany(EOM2,len) then OSD+1.
EOMc2 is valresult(C,^EOMos2).
EOM3 if Month()=4 and valresult(month(),1)=3 and year()=year.
EOMos3 is scanany(EOM3,len) then OSD+1.
EOMc3 is valresult(C,^EOMos3).
EOM4 if Month()=5 and valresult(month(),1)=4 and year()=year.
EOMos4 is scanany(EOM4,len) then OSD+1.
EOMc4 is valresult(C,^EOMos4).
EOM5 if Month()=6 and valresult(month(),1)=5 and year()=year.
EOMos5 is scanany(EOM5,len) then OSD+1.
EOMc5 is valresult(C,^EOMos5).
EOM6 if Month()=7 and valresult(month(),1)=6 and year()=year.
EOMos6 is scanany(EOM6,len) then OSD+1.
EOMc6 is valresult(C,^EOMos6).
EOM7 if Month()=8 and valresult(month(),1)=7 and year()=year.
EOMos7 is scanany(EOM7,len) then OSD+1.
EOMc7 is valresult(C,^EOMos7).
EOM8 if Month()=9 and valresult(month(),1)=8 and year()=year.
EOMos8 is scanany(EOM8,len) then OSD+1.
EOMc8 is valresult(C,^EOMos8).
EOM9 if Month()=10 and valresult(month(),1)=9 and year()=year.
EOMos9 is scanany(EOM9,len) then OSD+1.
EOMc9 is valresult(C,^EOMos9).
EOM10 if Month()=11 and valresult(month(),1)=10 and year()=year.
EOMos10 is scanany(EOM10,len) then OSD+1.
EOMc10 is valresult(C,^EOMos10).
EOM11 if Month()=12 and valresult(month(),1)=11 and year()=year.
EOMos11 is scanany(EOM11,len) then OSD+1.
EOMc11 is valresult(C,^EOMos11).
EOM12 if Month()=1 and valresult(month(),1)=12 and valresult(year(),1)=year.
EOMos12 is scanany(EOM12,len) then OSD+1.
EOMc12 is valresult(C,^EOMos12).
YEARavg is (EOMc1+EOMc2+EOMc3+EOMc4+EOMc5+EOMc6+EOMc7+EOMc8+EOMc9+EOMc10+EOMc11+EOMc12)/12.
AR1 is (EOMc1 / YEARavg-1)*100.
AR2 is (EOMc2 / YEARavg-1)*100.
AR3 is (EOMc3 / YEARavg-1)*100.
AR4 is (EOMc4 / YEARavg-1)*100.
AR5 is (EOMc5 / YEARavg-1)*100.
AR6 is (EOMc6 / YEARavg-1)*100.
AR7 is (EOMc7 / YEARavg-1)*100.
AR8 is (EOMc8 / YEARavg-1)*100.
AR9 is (EOMc9 / YEARavg-1)*100.
AR10 is (EOMc10 / YEARavg-1)*100.
AR11 is (EOMc11 / YEARavg-1)*100.
AR12 is (EOMc12 / YEARavg-1)*100.
EOMc if firstdate < makedate(1,20,2019-20).
AR if EOMc.

The EDS code is not a trading system but a way to get the data needed into an Excel spreadsheet to enable you to make the seasonal calculations. The EDS file should be run on a date after the end of the year being calculated. Each year for which data is needed must be run separately by setting the “year” variable. Multiple symbols can be run at the same time by using a list of the desired symbols. Each time a year is run, the “AR” report must be saved as a “.csv” file. Once all the years needed have been run and saved to separate “.csv” files, they all should be cut and pasted to a single Excel sheet. They then can be sorted by symbol and each symbol can be copied and pasted to a tab for that symbol.

Figure 6 shows the rolling four-year frequency for the S&P 500 ETF (SPY) and Figure 7 shows the annual trades resulting from applying the seasonal rules to the frequency data.

FIGURE 6: AIQ. Shown here is the rolling four-year frequency for the SPY.

FIGURE 7: AIQ. Shown here are the annual trades resulting from applying the seasonal rules to the frequency data for SPY.

The importable AIQ EDS file based on Vitali Apirine’s article in July 2019 Stocks & Commodities issue, “Exponential Deviation Bands,”

and a recreated Excel spreadsheet similar to the one shown in the article can be obtained on request via email to info@TradersEdgeSystems.com. The code is also shown here:

Exponential deviation (ED) bands are plotted above and below a moving average (MA) from which the bands are calculated. An exponential deviation from the moving average is used to set the bands. ED bands can be used with either a simple moving average (SMA) or an exponential moving average (EMA). The moving average dictates direction, and the exponential deviation sets band width. Breakouts from the band and changes in the band’s direction can help identify price trends and price reversals. These bands can be used on a variety of securities with its standard settings.

!EXPONENTIAL DEVIATION BANDS
!Author: Vitali Apirine, TASC July 2019
!Coded by: Richard Denning, 5/15/2019
!www.TradersEdgeSystems.com
C is [close].
Periods is 20.
MA20 is simpleavg(C,Periods). !expavg(C,Periods). !or simpleavg(C,Periods).
MDev20 is (Abs(MA20-C)+Abs(MA20-valresult(C,1))+Abs(MA20-valresult(C,2))+Abs(MA20-valresult(C,3))
+Abs(MA20-valresult(C,4))+Abs(MA20-valresult(C,5))+Abs(MA20-valresult(C,6))+Abs(MA20-valresult(C,7))
+Abs(MA20-valresult(C,8))+Abs(MA20- valresult(C,9))+Abs(MA20- valresult(C,10))+Abs(MA20- valresult(C,11))
+Abs(MA20- valresult(C,12))+Abs(MA20- valresult(C,13))+Abs(MA20- valresult(C,14))+Abs(MA20- valresult(C,15))
+Abs(MA20- valresult(C,16)) +Abs(MA20- valresult(C,17))+Abs(MA20- valresult(C,18))+Abs(MA20- valresult(C,19)))/20.
Dev is Abs(MA20-C).
Rate is 2/( Periods +1).
DaysInto is ReportDate() - RuleDate().
Stop if DaysInto >= 200.
stopEXD is iff(Stop,Mdev20, EXD).
EXD is Dev*Rate + valresult(stopEXD,1)*(1-Rate).
UpperExp is MA20+2*EXD.
MidExp is MA20.
LowerExp is MA20-2*EXD.
ShowValues if 1.

Figure 9 shows the exponential deviation bands centered on a 20-bar simple moving average on a chart of the New York Composite Index (NYA).

FIGURE 9: AIQ. Here are exponential deviation bands centered on a 20-bar simple moving average on a chart of the New York Composite Index (NYA).

The importable AIQ EDS file based on Anthony Garner’s article in May 2019 Stocks & Commodities “Backtesting A Mean-Reversion Strategy In Python,” can be obtained on request via email to info@TradersEdgeSystems.com. The code is also shown below.

I backtested the author’s mean-reversion system (MeanRev.eds) using both the EDS module, which tests every trade on a one-share basis, and also via the Portfolio Manager, which performs a trading simulation.

The short side strategy showed a loss overall in the EDS test so I tested only the long side in the Portfolio Manager. I selected trades using the z-score, taking the lowest values.

For capitalization, I used max of three trades per day with a max total of 10 open trades at one time, 10% allocated to each position. I did not deduct slippage but did deduct commissions. I used a recent list of the NASDAQ 100 stocks to run the test. The equity curve and account statistics report are shown in Figure 7.

FIGURE 7: AIQ. This shows the equity curve (blue line) from long-only trading the NASDAQ 100 list of stocks from 1999 to March 15, 2019. The red line is the NDX index.

!Backtesting a Mean-Reversion Strategy In Python !Author: Anthony Garner, TASC May 2019 !Coded by: Richard Denning 3/14/19 !www.TradersEdgeSystems.com

!ABBREVIATIONS: C is [close].

!INPUTS: meanLen is 10. longZmult is -1. shortZmult is 1. meanMult is 10.

!FORMULAS:

SMA is simpleavg(C,meanLen). LMA is simpleavg(C,meanLen*meanMult). STD is sqrt(variance(C,meanLen)). zScore is (C - SMA) / STD.

!TRADING SIGNALS & EXITS:

buyLong if zScore < longZmult and SMA > LMA. sellShort if zScore > shortZmult and SMA < LMA. exitLong if valresult(zScore,1) < -0.5 and zScore > 0.5. exitShort if valresult(zScore,1) > 0.5 and zScore < -0.5.

The AIQ code based on Vitali Apirine’s article in the September issue of Stocks and Commodities, “Weekly and Daily Stochastics, is provided below

Using Apirine’s weekly and daily stochastic indicators and a moving average to determine trend direction, I created an example system (long only) with the following rules:

Enter long next bar at open when all of the following are true:

The 200-day simple average of the NDX is greater than the day before

The 200-day simple average of the stock is greater than the day before

Both the weekly and daily stochastic indicators have been below 20 in the last five days

Both the weekly and daily stochastic indicators are greater than the day before.

I tested three exits. Figure 8 shows a 21-day hold then exit. Figure 9 shows a three-moving-average trend-following exit. Figure 10 shows an exit using only the weekly & daily stochastic, once both are lower than the day before.

FIGURE 8: AIQ, BUY and HOLD. Here is the sample equity curve (blue) compared to the NDX (red) for the test using a 21-day hold exit.

FIGURE 9: AIQ, TREND-FOLLOWING EXIT. Here is the sample equity curve (blue) compared to the NDX index (red) for the test using a trend-following exit.

FIGURE 10: AIQ, W and D STOCHASTIC EXIT. Here is the sample equity curve (blue) compared to the NDX index (red) for the test using the weekly and daily stochastic indicators.

The 21-day hold test showed a 11.2% return with a maximum drawdown of 29.3%. The trend-following exit test showed a 17.6% return with a maximum drawdown of 28.8%. The test using an exit based on only the weekly and daily stochastic indicators showed a return of 2.9% with a maximum drawdown of 32.5%. All the tests used the same entry rule and were run on an old 2016 list of the NASDAQ 100 stocks with the stocks that are no longer trading deleted.

!WEEKLY AND DAILY STOCHASTIC
!Author: Vitali Apirine, TASC Sept 2018
!Coded by: Richard Denning 7/7/2018
!www.TradersEdgeSystems.com
!INPUTS:
Periods is 14.
Periods1 is 3.
Pds is 70.
Pds1 is 3.
smaLen1 is 70.
exitType is 1.
!ABBREVIATIONS:
C is [close].
H is [high].
L is [low].
!INDICATOR CODE:
STOCD is (C-LOWRESULT(L,Periods))/(HIGHRESULT(H,Periods)-LOWRESULT(L,Periods))*100.
SD is Simpleavg(Stocd,Periods1).
StocW is (C-LOWRESULT(L,Pds))/(HIGHRESULT(H,Pds)-LOWRESULT(L,Pds))*100.
SW is Simpleavg(Stocw,Pds1).
HD if hasdatafor(1000) >= 500.
SMA200 is simpleavg(C,200).
SMA200ndx is tickerUDF("NDX",SMA200).
!SYSTEM CODE:
Buy if SMA200ndx > valresult(SMA200ndx,1)
and SMA200 > valresult(SMA200,1)
and SW > valresult(SW,1)
and SD > valresult(SD,1)
and countof(SW < 20,5)>=1
and countof(SD < 20,5)>=1
and HD.
smaLen2 is smaLen1*2.
smaLen3 is smaLen1*4.
SMA1 is simpleavg(C,smaLen1).
SMA2 is simpleavg(C,smaLen2).
SMA3 is simpleavg(C,smaLen3).
PD is {position days}.
!EXIT TYPE 1 USES THE INDICATOR ONLY
!EXIT TYPE 2 IS TREND FOLLOWING
Sell if (SD < valresult(SD,1) and SW < valresult(SW,1) and exitType=1)
or (exitType = 2
and ((Valresult(C,PD)valresult(SMA1,PD) And Cvalresult(SMA2,PD) And Cvalresult(SMA3,PD) And C 250)).
RSS is C/valresult(C,120).
RSL is C/valresult(C,240).

The AIQ code based on Domenico D’Errico’s article in the August issue of Stocks & Commodities magazine, “Portfolio Strategy Based On Accumulation/Distribution,” is shown below.

“Whether you are an individual trader or an asset manager, your main goal in reading a chart is to detect the intentions of major institutions, large operators, well-informed insiders, bankers and so on, so you can follow them. Here, we’ll build an automated stock portfolio strategy based on a cornerstone price analysis theory.”

!Portfolio Strategy Based on Accumulation/Distribution
!Author: Domenic D'Errico, TASC Aug 2018
!Coded by: Richard Denning 6/10/18
!www.TradersEdgeSystem.com
!Portfolio Strategy Based on Accumulation/Distribution
!Author: Domenic D'Errico, TASC Aug 2018
!Coded by: Richard Denning 6/10/18
!www.TradersEdgeSystem.com
!SET TO WEEKLY MODE IN PROPERTIES
!ALSO VIEW CHARTS IN WEEKLY MODE
!INPUTS:
rLen is 4.
consolFac is 75. ! in percent
adxTrigger is 30.
volRatio is 1.
volAvgLen is 4.
volDelay is 4.
!CODING ABREVIATIONS:
H is [high].
L is [low].
C is [close].
C1 is valresult(C,1).
H1 is valresult(H,1).
L1 is valresult(L,1).
!RANGE ACCUMULATION/DISTRIBUTION:
theRange is hival([high],rLen) - loval([low],rLen).
Consol if theRange < consolFac/100 * valresult(theRange,rLen).
rRatio is theRange/valresult(theRange,4)*100.
!AVERAGE TRUE RANGE ACCUMULATION/DISTRIBUTION:
avgLen is rLen * 2 - 1.
TR is Max(H-L,max(abs(C1-L),abs(C1-H))).
ATR is expAvg(TR,avgLen).
ConsolATR if ATR < consolFac/100 * valresult(ATR,rLen). atrRatio is ATR / valresult(ATR,4)*100. !ADX ACCUMULATION/DISTRIBUTION: !ADX INDICATOR as defined by Wells Wilder rhigh is (H-H1). rlow is (L1-L). DMplus is iff(rhigh > 0 and rhigh > rlow, rhigh, 0).
DMminus is iff(rlow > 0 and rlow >= rhigh, rlow, 0).
AvgPlusDM is expAvg(DMplus,avgLen).
AvgMinusDM is expavg(DMminus,avgLen).
PlusDMI is (AvgPlusDM/ATR)*100.
MinusDMI is AvgMinusDM/ATR*100.
DIdiff is PlusDMI-MinusDMI.
Zero if PlusDMI = 0 and MinusDMI =0.
DIsum is PlusDMI+MinusDMI.
DX is iff(ZERO,100,abs(DIdiff)/DIsum*100).
ADX is ExpAvg(DX,avgLen).
ConsolADX if ADX < adxTrigger. !CODE FOR ACCUMULATIOIN/DISTRIBUTION RANGE BREAKOUT: consolOS is scanany(Consol,250) then offsettodate(month(),day(),year()). Top is highresult([high],rLen,^consolOS). Top0 is valresult(Top,^consolOS) then resetdate(). Bot is loval([low],rLen,^consolOS). AvgVol is simpleavg([volume],volAvgLen). Bot12 is valresult(Bot,12). BuyRngBO if [close] > Top
and ^consolOS <= 5 and ^consolOS >= 1
and Bot > Bot12
and valresult(AvgVol,volDelay)>volRatio*valresult(AvgVol,volAvgLen+volDelay).
EntryPrice is [close].
Sell if [close] < loval([low],rLen,1).
ExitPrice is [close].

Figure 9 shows the summary backtest results of the range accumulation breakout system using NASDAQ 100 stocks from December 2006 to June 2018. The exits differ from the author’s as follows: I used two of the built-in exits — a 20% stop-loss and a profit-protect of 40% of profits once profit reaches 10%.

FIGURE 9: AIQ. Here are the summary results of a backtest using NASDAQ 100 stocks.

Figure 10 shows a color study on REGN. The yellow bars show where the range accumulation/distribution shows a consolidation.

FIGURE 10: AIQ. This color study shows range consolidation (yellow bars).

The AIQ code based on Markos Katsanos’ article in this issue, “A Technical Method For Rating Stocks,” is shown below.

Synopsis from Stocks & Commodities June 2018

I’s it possible to create a stock rating system using multiple indicators or other technical criteria? If so, how does it compare with analyst ratings? Investors around the world move billions of dollars every day on advice from Wall Street research analysts. Most retail investors do not have the time or can’t be bothered to read the full stock report and rely solely on the bottom line: the stock rating. They believe these ratings are reliable and base their investment decisions at least partly on the analyst buy/sell rating. But how reliable are those buy/sell ratings? In this article I will present a technical stock rating system based on five technical criteria and indicators, backtest it, and compare its performance to analyst ratings.

!A TECHNICAL METHOD FOR RATING STOCKS
!Author: Markos Katsanos, TASC June 2018
!Coded by: Richard Denning, 4/18/18
!www.TradersEdgeSystems.com
!INPUTS:
MAP is 63.
STIFFMAX is 7.
VFIPeriod is 130.
MASPY is 100.
MADL is 100.
SCORECRIT is 5.
W1 is 1.
W2 is 1.
W3 is 1.
W4 is 1.
W5 is 2.
!VFI FORMULA:
COEF is 0.2.
VCOEF is 2.5.
Avg is ([high]+[low]+[close])/3.
inter is ln( Avg ) - ln( Valresult( Avg, 1 ) ).
vinter is sqrt(variance(inter, 30 )).
cutoff is Coef * Vinter * [Close].
vave is Valresult(simpleavg([volume], VFIPeriod ), 1 ).
vmax is Vave * Vcoef.
vc is Min( [volume], VMax ).
mf is Avg - Valresult( Avg, 1 ).
vcp is iff(MF > Cutoff,VC,iff(MF < -Cutoff,-VC,0)).
vfitemp is Sum(VCP , VFIPeriod ) / Vave.
vfi is expavg(VFItemp, 3 ).
!STIFFNESS
ma100 is Avg.
CLMA if [close] < MA100.
STIFFNESS is countof(CLMA,MAP).
!CONDITIONS:
! MONEY FLOW:
COND1 is iff(VFI>0,1,0).
!SIMPLEAVG:
SMA is simpleavg([close],MADL).
COND2 is iff([close]>SMA,1,0).
!SIMPLEAVG DIRECTION:
COND3 is iff(SMA>valresult(SMA,4),1,0).
!STIFFNESS:
COND4 is iff(STIFFNESS<= STIFFMAX,1,0).
!MARKET DIRECTION:
SPY is TickerUDF("SPY",[close]).
COND5 is iff(EXPAVG(SPY,MASPY)>=
valresult(EXPAVG(SPY,MASPY),2),1,0).
SCORE is W1*COND1+W2*COND2+W3*COND3+
W4*COND4+W5*COND5.
buy if Score>=SCORECRIT and hasdatafor(300)>=268.

Figure 11 shows the summary results of a backtest using NASDAQ 100 stocks during a generally bullish period from April 2009 to April 2018. Figure 12 shows the backtest using the same list of NASDAQ 100 stocks during a period that had two bear markets (April 1999 to April 2009). The average results are similar except that there are fewer trades during the period that contained the two bear markets. Both backtests use a fixed 21-bar exit.

FIGURE 11: AIQ, BULL MARKET. Here are the summary results of a backtest using NASDAQ 100 stocks during a generally bullish period from April 2009 to April 2018.

FIGURE 12: AIQ, BEAR MARKET. Here are the summary results of a backtest using NASDAQ 100 stocks during a period from April 1999 to April 2009 that contained two bear markets.

The AIQ code based on Vitali Apirine’s article in Stocks & Commodities issue, “Weekly & Daily Percentage Price Oscillator,” Modifying a traditional indicator can make you look at a chart differently. You can compare indexes, look at price movements during extended periods of time, and make trading decisions based on your observations is provided here:

!WEEKLY & DAILY PPO
!Author: Vitali Apirine, TASC Feb 2018
!Coded by: Richard Denning 12/17/17
!www.TradersEdgeSystems.com
!INPUTS:
S is 12.
L is 26.
EMA1 is expavg([Close],S).
EMA2 is expavg([Close],L).
EMA3 is expavg([Close],S*5).
EMA4 is expavg([Close],L*5).
DM is (EMA1 - EMA2)/EMA4*100.
WM is (EMA3 - EMA4)/EMA4*100.
WD_PPO is WM + DM.

Figure below shows the daily and weekly PPO indicator on a chart of the Nasdaq 100 index (NDX) from 2015 to 2017.

Here, the daily & weekly PPO is displayed on a chart of the NDX.

The AIQ code based on Vitali Apirine’s article in December 2017 issue of Stocks and Commodities magazine, “Weekly & Daily MACD,” is provided below.

The moving average convergence/divergence oscillator (MACD), developed by Gerald Appel, is one of the more popular technical analysis indicators. The MACD is typically used on a single timeframe, but what if we looked at two timeframes on one chart?

Traders can look for relative daily MACD line crossovers, weekly and daily centerline crossovers, and divergences to generate trading signals.

Figure 5 shows the daily & weekly MACD indicator on a chart of Apple Inc. (AAPL) during 2016 and 2017, when there was a change from a downtrend to an uptrend.

FIGURE 5: AIQ. Here is an example of the daily & weekly MACD on a chart of AAPL.

!WEEKLY & DAILY MACD
!Author: Vitali Apirine, TASC Dec 2017
!Coded by: Richard Denning 10/13/17
!www.TradersEdgeSystems.com
!INPUTS:
S is 12.
L is 25.
EMA1 is expavg([Close],S).
EMA2 is expavg([Close],L).
EMA3 is expavg([Close],S*5).
EMA4 is expavg([Close],L*5).
MACD is EMA1 - EMA2.
MACDW is EMA3 - EMA4.
rdMACD is MACD + MACDW.

The AIQ code based on Domenico D’Errico and Giovanni Trombetta’s article in August 2017 Stock & Commodities issue, “System Development Using Artificial Intelligence,” is shown here. You can also download the EDS file from here

Are humans or computers better at trading? This question has been around on many fronts since the era of punch cards, and as technology advances, you question whether machines have limits. It’s the same with trading, and here’s an algorithm that may shed some light on which performs better…

!ARTIFICAL INTELLIGENCE FOR SYSTEM DEVELOPMENT
!Authors: Domenico D'Errico & Giovanni Trombetta, TASC August 2017
!Coded by: Richard Denning, 6/08/2017
!www.TradersEdgeSystems.com
!INPUTS:
O is [open].
C is [close].
H is [high].
L is [low].
exitBars is 8.
exitBarsP is 6.
enterGap is -0.08.
!CODE:
AvgP is (O+C+H+L)/4.
MedP is (H+L)/2.
MedB is (O+C)/2.
AvgP1 is valresult(AvgP,1).
AvgP2 is valresult(AvgP,2).
AvgP3 is valresult(AvgP,3).
MedP1 is valresult(MedP,1).
MedP2 is valresult(MedP,2).
MedP3 is valresult(MedP,3).
MedP4 is valresult(MedP,4).
MedB1 is valresult(MedB,1).
MedB2 is valresult(MedB,2).
MedB3 is valresult(MedB,3).
MedB4 is valresult(MedB,4).
!ENTRY & EXIT RULESl
Gandalf if
(AvgP1exitBars-1)
or ({position days}>=exitBars-1)
or ({position days}>=exitBarsP-1 and (C-{position entry price}>0)).
EntryPr is min(val([low],1) + enterGap,[open]).
Buy if Gandalf and [low] <= EntryPr.

See Figure 10 for how to set up the pricing in a backtest.

FIGURE 10: AIQ. This shows the EDS backtest settings for entry pricing.

The AIQ code based on Domenico D’Errico’s article in the May 2017 issue of Stoks Commodities, “Detecting Swings,” is provided below.

I tested the author’s four systems using the NASDAQ 100 list of stocks on weekly bars, as did the author, from 3/16/2005 through 3/14/2017. Figure 7 shows the comparative metrics of the four systems using the four-week exit. The results were quite different than the author’s, probably due to a different test portfolio and also a 10-year test period rather than the author’s 20-year period. In addition, my test results show longs only, whereas the author’s results are the average of both the longs and shorts.

FIGURE 7: AIQ. As coded in EDS, this shows the metrics for the author’s four systems run on NASDAQ 100 stocks (weekly bar data) over the period 3/16/2005 to 3/14/2007.

The Bollinger Band (Buy2) system showed the worst results, whereas the author’s results showed the Bollinger Band system as the best. The pivot system (Buy1) showed the best results, whereas the author’s results showed the pivot system as the worst. I am not showing here the comparative test results for the Sell1 thru Sell4 rules, as all showed an average loss over this test period.

!DECTECTING SWINGS
!Author: Domenico D'Errico, TASC May 2017
!Coded by: Richard Denning, 3/15/17
!www.TradersEdgeSystems.com
!Set to WEEKLY in properties
Low is [low].
Low1 is valresult(Low,1).
Low2 is valresult(Low,2).
High is [high].
High1 is valresult(High,1).
High2 is valresult(High,2).
PivotLow if Low1 < Low2 and Low1 < Low.
PivotHigh if High1 > High2 and High1 > High.
Buy1 if PivotLow.
Sell1 if PivotHigh.
!Set parameter for bollinger bands to 12 with 2 sigma (weekly) in charts:
Buy2 if [close] > [Lower BB] and valrule([close] <= [Lower BB],1).
Sell2 if [close] < [Upper BB] and valrule([close] >= [Upper BB],1).
!Set parameter for Wilder RSI to 5 (weekly) in charts:
Buy3 if [RSI Wilder] > 40 and valrule([RSI Wilder] <= 40,1).
Sell3 if [RSI Wilder] < 60 and valrule([RSI Wilder] >= 60,1).
Buy4 if [RSI Wilder] < 40 And Low > Low1.
Sell4 if [RSI Wilder] > 60 And High < High1.
Exit if {position days} >= 4.

The AIQ code based on Vitali Apirine’s article in the 2017 issue of Stocks & Commodities magazine, “Exponential Standard Deviation Bands”

Editor note: “Author Vitali Apirine presented a method intended to help traders see volatility while a stock is trending. These bands, while similar to Bollinger Bands, are calculated using exponential moving averages rather than simple moving averages. Like Bollinger Bands, they widen when volatility increases and narrow as volatility decreases. He suggests that the indicator can be used as a confirming indication along with other indicators such as the ADX. Here’s an AIQ Chart with the Upper, Lower and Middle Exponential SD added as custom indicators.”

To compare the exponential bands to Bollinger Bands, I created a trend-following trading system that trades long only according to the following rules:

Buy when there is an uptrend and the close crosses over the upper band. An uptrend is in place when the middle band is higher than it was one bar ago.

Sell when the low is less than the lower band.

Figure 8 shows the summary test results for taking all signals from the Bollinger Band system run on NASDAQ 100 stocks over the period 12/9/2000 to 12/09/2016. Figure 9 shows the summary test results for taking all signals from the exponential band system on NASDAQ 100 stocks over the same period. The exponential band system improved the average profit per trade while reducing the total number of trades.

FIGURE 8: AIQ. Here are summary test results for taking all signals from the Bollinger Band system run on NASDAQ 100 stocks over the period 12/9/2000 to 12/09/2016.

FIGURE 9: AIQ. Here are summary test results for taking all signals from the exponential band system run on NASDAQ 100 stocks over the period 12/9/2000 to 12/09/2016.

!Exponential Standard Deviation Bands
!Author: Vitali Apirine, TASC February 2017
!Coded by: Richard Denning 12/11/2016
!www.TradersEdgeSystems.com!INPUT:
xlen is 20.
numSD is 2.

!INDICATOR CODE:
ExpAvg is expavg([close],xlen).
Dev is [close] – ExpAvg.
DevSqr is Dev*Dev.
SumSqr is sum(DevSqr,xlen).
AvgSumSqr is SumSqr / xlen.
ExpSD is sqrt(AvgSumSqr).

!UPPER EXPONENTIAL SD BAND:
UpExpSD is ExpAvg + numSD*ExpSD. !PLOT ON CHART

!LOWER EXPONENTIAL SD BAND:
DnExpSD is ExpAvg – numSD*ExpSD. !PLOT ON CHART

!MIDDLE EXPONENTIAL SD BAND:
MidExpSD is ExpAvg.

!BOLLINGER BANDS FOR COMPARISON:
DnBB is [Lower BB]. !Lower Bollinger Band
UpBB is [Upper BB]. !Upper Bollinger Band
MidBB is simpleavg([close],xlen). !Middle Bollinger Band
!REPORT RULE TO DISPLAY VALUES:
ShowValures if 1.

!TRADING SYSTEM USING EXPPONENTIAL SD BANDS:
UpTrend if MidExpSD > valresult(MidExpSD,1).
BreakUp if [close] > UpExpSD.
BuyExpSD if UpTrend and BreakUp and valrule(Breakup=0,1).
ExitExpSD if [Low] < DnExpSD. ! or UpTrend=0.

!TRADING SYSTEM USING BOLLINGER BANDS:
UpTrendBB if MidBB > valresult(MidBB,1).
BreakUpBB if [close] > UpBB.
BuyBB if UpTrendBB and BreakUpBB and valrule(BreakupBB=0,1).
ExitBB if [Low] < DnBB. ! or UpTrend=0.

The AIQ code based on Barbara Star’s article in May issue of Stocks and Commodities “Zero In On The MACD,” is provided at www.TradersEdgeSystems.com/traderstips.htm, and is also shown below.

FIGURE 7: AIQ. Here is a sample chart of VIAB with MACDhist, the color bars, and the 34- and 55-bar EMAs.

Figure 7 shows the MACD histogram on a chart of Viacom (VIAB) with the color bars and the 34- and 55-bar exponential moving averages (EMA). Note that I did not code the weighted moving average (WMA) but substituted the EMA for the WMA. I chose to view the chart of VIAB by running the EDS “Zero MACD.eds” on 3/14/2016 and examining the alert messages on the report “List.” VIAB is the only one on that date that showed a cross up on the MACDhist (see Figure 8 for a look at part of this report for 3/14/2016).

FIGURE 8: AIQ. This shows part of the EDS custom report “List” that shows the MACDhist values on 3/14/2016, the color status, and any alerts that were generated for that day.

! ZERO IN ON THE MACD
! Author: Barbara Star, TASC May 2016
! Coded by: Richard Denning 3/14/16
! www.TradersEdgeSystems.com
! INPUTS:
macd1 is 12.
macd2 is 26.
macdSig is 1.
! INDICATORS:
emaST is expavg([Close],macd1).
emaLT is expavg([Close],macd2).
MACD is emaST - emaLT. ! MACD line
SigMACD is expavg(MACD,macdSig). ! MACD Signal line
MACDosc is MACD - SigMACD. ! MACD Oscillator
HD if hasdatafor(macd2) = macd2.
MACDhist is MACD. ! plot as historigram
MACDblue if MACDhist > 0. ! use these rules to color MACDhist
MACDred if MACDhist < 0. ! use these rules to color MACDhist
MACDcolor is iff(MACDblue and HD,"Blue",iff(MACDred and HD,"Red","White")). !for report list
List if 1.
!ALERTS:
EMA1 is expavg([close],34).
EMA2 is expavg([close],55).
xupEMA1 if [close] > EMA1 and valrule([close] < EMA1,1).
xdnEMA1 if [close] < EMA1 and valrule([close] > EMA1,1).
xupEMA2 if [close] > EMA2 and valrule([close] < EMA2,1).
xdnEMA2 if [close] < EMA2 and valrule([close] > EMA2,1).
xupMACD if MACDhist > 0 and valrule(MACDhist < 0,1).
xdnMACD if MACDhist < 0 and valrule(MACDhist > 0,1).
UpAlerts is iff(xupEMA1,"xupEMA1",iff(xupEMA2,"xupEMA2",iff(xupMACD,"xupMACD"," "))).
DnAlerts is iff(xdnEMA1,"xdnEMA1",iff(xdnEMA2,"xdnEMA2",iff(xdnMACD,"xdnMACD"," "))).

Save this file to your/wintes32/EDS Strategies folder.

Since I mainly work with daily bar strategies, I wanted to test the gap-down concept on a daily bar trading system rather than on one-minute bars. I set up a system that buys after a stock has gapped down at least 10% in the last two days and then trades above the high of the gap-down bar. The entry is then at the close of that bar. For exits, I used the built-in exit, the profit-protect exit set at 80% once profit reaches 3% or more combined with a stop-loss using the low of the gap-down bar and also a time exit set to five bars.

I then ran this system on the NASDAQ 100 list of stocks in the EDS backtester over the period 12/31/1999 to 1/11/2016 (Figure 7). The system generated 303 trades with an average profit of 1.09% per trade with a reward-to-risk ratio of 1.35. Slippage and commissions have not been deducted from these results.

FIGURE 7: AIQ. This shows the EDS test results for the example system.

Again, the code and EDS file can be downloaded from www.TradersEdgeSystems.com/traderstips.htm, and is also shown below.

!TRADING GAP REVERSALS
!Author: Ken Calhoun, TASC April 2016
!Coded by: Richard Denning 2/1/2016
!www.TradersEdgeSystems.com
!INPUTS:
GapSize is 10.
GapLookBack is 5.
MaxBars is 5.
!CODING ABBREVIATIONS:
H is [high].
C is [close].
C1 is val([close],1).
L is [low].
O is [open].
GapD is (O / C1 - 1) * 100.
GapOS is scanany(GapD < -GapSize,GapLookBack) <> nodate()
then offsettodate(month(),day(),year()).
Hgap is valresult(H,^GapOS).
Lgap is valresult(L,^GapOS).
SU if scanany(GapD < -GapSize,GapLookBack).
SU1 if scanany(GapD < -GapSize,GapLookBack,1).
SU2 if scanany(GapD < -GapSize,GapLookBack,2).
LE if ((SU1 then resetdate()) or (SU2 then resetdate()))
and H > Hgap.
ExitLong if {position days} > maxBars
or C < Lgap.
EntryPr is max(O,Hgap).
List if C > 0.

In this article I detailed one relatively “simple” approach to using the MACD indicator to identify potentially bullish opportunities. In this piece we will look at one to actually put those signals to use.

The Limited Risk Call Option

One possibility upon generating a bullish signal as described in the last article is to buy shares of the stock/ETF/index/etc in question. Not a thing wrong with that. But there is a less expensive alternative.

Figure 1 reproduces Figure 1 from the last piece showing ticker XLF. Let’s look at the signal generated on 2/12/16.

One alternative that I like is to use the “Percent to Double” routine at www.OptionsAnalysis.com to find an inexpensive call option that has lot of upside potential. The input screen with a few key input selections highlighted appears in Figure 1a (if it looks intimidating please note that a reusable set of criteria can be captured in a “Saved Wizard”, which appear towards the lower right of of Figure 1a. Once a set of criteria is saved it can be reused by simply clicking on the Wizard name and clicking “Load”.)

NOTE: My own personal preference is to consider options that have at least 45 days left until expiration (as time decay can become a very negative factor as option expiration draws closer).

NOTE: For my own purposes I like to see a Delta of at least 40 for the option I might consider buying (nothing “scientific” here. It is just that the lower the Delta the further out-of-the-money the option strike price is. I prefer to buy a strike price that is not too far from the current price of the stock; hence I look for a Delta of 40 or higher). With XLF trading at $20.49, in Figure 1b I have highlighted the 2nd choice on the list – the April 21 call – which has a delta of 43.Figure 1b – Percent to Double Output (Courtesy www.OptionsAnalysis.com)

So a trader now has two alternatives:

*Buy 2 Apr 21 strike price XLF calls for $70 apiece ($140 total cost; 86 total deltas)

*Buy 86 shares of XLF at $20.49 apiece ($1,760 total cost, 86 total deltas)

Figure 1c displays the particulars for buying a 2-lot of the April 21 call for a total cost of $140.Figure 1c – XLF Apr 21 call (Courtesy www.OptionsAnalysis.com)

By 3/18 the shares had gained 11% and the Apr 21 call had gained 143%. See Figure 1d.Figure 1d – XLF Apr 21 call (Courtesy www.OptionsAnalysis.com)

Summary

Obviously not every trade works out as well as this one. Still, the key things to remember are:

*The option trade cost $140 instead of $1760

*The worst case scenario was a loss of $140.

Something to think about.

Chief Market Analyst at JayOnTheMarkets.com and TradingExpert Pro client

One danger of getting “way to into” the financial markets is that you can find yourself progressing into some needlessly complicated stuff (“Hi, my name is Jay”). I mean it is only natural to wonder “hey, what if I divided this indicator value by that indicator value” and such. But once you start finding yourself taking an exponential moving average of a regression line with a variable lag time, well, you can find yourself “a tad far afield.” (Trust me on this one). Which leads us directly to:

Jay’sTradingMaxim #44: Every once in awhile it pays to remember that the end goal is simply to make money. The more easily the better.

So today let’s go back to a simple “basic approach.”

The Bullish MACD Divergence

We will define an “asset” as any stock, ETF, commodity, index, etc. that can be traded on an exchange (and for my purposes, there should be a liquid market for options on that asset).

Step 1. An asset price falls to a new 20-day low and the MACD value is less than 0. Note the MACD value on this date.

Step 2. Not less than one week but not more than 2 months later:

*Price closes below its closing level in Step 1

*The MACD indicator is above its level at the time of Step 1

Step 3. The next time the daily MACD indicator “ticks higher” a buy alert is triggered

Can it really be that simple? The Good News is “Yes, it can.” The Bad News is that “It isn’t always.” To put it another way, like a lot of trading methods it can generate a surprising abundance of useful trading signals. However, there is no guarantee that any given signal will turn out to be timely. In other words:

This method gives you a good guideline for when to get in, but:

*It may be early at times (i.e., price will move lower still before advancing)

*It will at times be flat out wrong

*You still have to decide when to exit the bullish position.

*Call options are useful with this approach as it allows you to risk a limited amount of capital.

Examples

Figures 1 through 4 highlight some recent examples using this method. Note that the charts show only entry points. Exit points are “a separate topic”.

As you can see, some signals were quite timely while others were quite early. For the record, I started getting bullish on gold and gold stocks early in 2016 based in part on the multiple alerts that appear in Figure 4.

Chief Market Analyst at JayOnTheMarkets.com and TradingExpert Pro client

The AIQ code based on Ken Calhoun’s article in the March 2016 issue of Stocks and Commodities, “ADX Breakouts,” is provided at www.TradersEdgeSystems.com/traderstips.htm.

Since I mainly work with daily bar strategies, I wanted to test the ADX concept from the article on a daily bar trading system. So I set up a system that buys after a stock has based around the 200-day simple moving average (Basing200). Basing200 is coded in the system as:

The stock closing above the 200-SMA only 19 bars or less out of the last 100 bars, and

The stock closing greater than two bars above the 200-SMA in the last 10 bars.

For exits, I used the following built-in exits: a capital-protect exit set at 80% and a profit-protect exit set at 80% once profit reaches 5% or more.

I ran this system on the NASDAQ 100 list of stocks in the EDS backtester over the period 12/31/1999 to 1/11/2016. I then ran a second test on the system using the ADX filter (ADX must be greater than 40 at the time of the signal to buy). I used the same list of stocks, exits, and test period.

Figure 8 shows the first test without the filter: 883 trades, 1.84% average profit per trade, 1.51 reward/risk. Figure 9 shows the second test with the filter: 151 trades, 2.12% average profit per trade, 1.66 reward/risk.

FIGURE 8: AIQ, WITHOUT FILTER. Here are the EDS test results for the example system without the ADX filter.

FIGURE 9: AIQ, WITH FILTER. Here are the EDS test results for the example system with the ADX filter.

Although all of the key metrics are better with the filter, there is a significant reduction in the number of trades. In fact, 151 trades would not be sufficient for a trading system over this long test period. If one wanted to use the filter, then the list of stocks would need to be increased to about 2,000 stocks.

!ADX BREAKOUTS
!Author: Ken Calhoun, TASC March 2016
!Coded by: Richard Denning, 1/11/2016
!www.TradersEdgeSystems.com
!NOTE; THIS SAMPLE SYSTEM IS FOR
!DAILY BAR TESTING OF ADX FILTER ONLY
SMA200 is simpleavg([close],200).
HD is hasdatafor(250).
Above200 if ( [close] > SMA200 ) .
Basing200 if CountOf(Above200,10) >2
and CountOf(Above200,100) 200.
ADXhi if [ADX] >= 40.
BuyADX if Buy and ADXhi.