I don't want to enter the same situation like image.
CandleSize = abs(high-low)
Length = CandleSize < 30
I want to make code to satisfy the condition that applicable only green candle before entry
It would be nice if code could satisfy the condition either the candle before or the one before last
You can use the
ta.valuewhen()
for this purpose.