I have a breakout and retest setup to buy. I have coded it but it only records the latest breakout and forgets the previous breakouts. What if there is a breakout and there is no retest to it and then there is again a breakout and this time retest is there. Here I still want AFL to keep record the first breakout too. How do I make AFl to record multiple values?
Here I want to my AFL to keep recording 1) breakout and also record future breakouts too when they happen
Here is my afl
Resistance = Ref(HHV(H,50),-1);
Breakout = Cross(C,Resistance);
Breakout = Ref(Sum(Breakout,21) == 0,-1) AND Breakout AND C > (Resistance + Ref(ATR(5),-1));
BreakoutLevel = Ref(Valuewhen(Breakout,Resistance),-1);
Retest = Cross(BreakoutLevel,L);
Retest = Retest AND Cum(Retest) == 1;
Retest = Retest AND BarsSince(Breakout) < 21;
Ok , got it but i think it will not work as you want as it will also add all retest 's signals that happen from the beginning of chart , not only the most recent retest
if you plot "breakout" variable it would show you all historical breakout signals , so where is the problem ?
Yes it will plot correctly. But I am more interested in exploration i.e I want to find out those stocks which have retested on the breakout today (any- whether recent or previous).