Hi there
I’m attempting to write a weekly break up screener based on the following criteria but I’m not seeing the desired outcome with the breakout criteria – e.g I’m seeing results with the current candle below the previous candle
What am I doing wrong?
- Break out to new 20 week highs – breaking up ideally from consolidation from the previous 20 bars
- Rate of change above 30
- Price range between $.10 and $5
Here is my code
c1 = highest[21](close) [1]
c2 = close > c1 [1]
c3 = ROC[20] > 30
c4 = close >= 0.10 AND close <= 5
c5 = close >= open
screener[c1 and c2 and c3 and c4 and c5]
Thanks!
Try with this line 2:
close > c1
line 1 already references the previous bar, thus in your code you refer to the one preceding the previous one.