Trading Gap Reversals

The AIQ code based on Ken Calhoun’s article in April 2016 issue of Stock & Commodities Trading Gap Reversals”, is provided below. 
AIQ has also posted the EDS file at “ is provided for downloading at 
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.
Sample Chart
FIGURE 7: AIQ. This shows the EDS test results for the example system.
Again, the code and EDS file can be downloaded from, and is also shown below.
!Author: Ken Calhoun, TASC April 2016
!Coded by: Richard Denning 2/1/2016

GapSize is 10.
GapLookBack is 5.
MaxBars is 5.

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.
—Richard Denning

Leave a Reply