Given a candle series RGRRRRGGRRRRRRG, I would like to have an indicator to identify the first green candle after there has been at least four consecutive red candles.
In the example series above, the indicator should appear for the second green candle and the last green candle.
After such identification, is it possible to obtain the close price of the second G and last G?
I used var for the red candles and able to detect four consecutive reds, but unable to identify the green after that.