Follow Through Day (Amibroker And Tradestation Code)

The original article can be found here.

The strategy in plain English:

  1. The first day must close higher than the close yesterday.
  2. Day 2 and 3 must not have a low lower than day 1.
  3. On the fourth day, the gain is at least 0.75 of the 25-day average of the H-L.
  4. If 1-3 are correct, then buy at the close.

Amibroker code:

Buy = Close-Ref(C,-1)>(range*0.75) AND Ref(C,-1)>Ref(L,-3) AND Ref(C,-2)>Ref(L,-3) AND Ref(C,-3)>Ref(C,-4) ;
BuyPrice= Close ;
Sell=0;
SellPrice=Close ;

applyStop(stopTypeNBar,stopModeBars,oddis,1);

Tradestation code:

{
Strategy 114 - follow through day
1. The first day must close higher than the close yesterday.
2. Day 2 and 3 must not have a low lower than day 1.
3. On the fourth day, the gain is at least 0.75 of the 25-day average of the H-L.
If 1-3 are correct, then buy at the close.
}

Inputs: HoldBars(5);

Vars: rng(0);

if (Close- Close[1]) >(Average(range, 25)*0.75) AND Close[1] > Low[3] AND Close[2] > Low[3] AND Close[3] > Close[4] then 
	buy this bar on close;

if Barssinceentry(0) >= HoldBars then 
	sell this bar on close;