I’m new to Pine Script. I would like to mark the first up bar candle after the last down candle in a series of candles.
// UpBar
UpBar = close >= close[1] and open >= open[1]
//DownBar
DownBar = open <= open[1] and close >= close[1]
UpBar1 = not NormalBar[1] and UpBar
plotchar(UpBar1, color=color.blue)
Here is the problem
- only applied to previous candle
- it skipped some of the first upbar candle
How do I identify the last down bar candle and disregard any candles that come after except the first up bar candle and mark it? And how do I repeat the process for the entire series of candles?
New contributor
Ryan kenshin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.