Exploration of multiple candles

Hi Gurus,

I want to write an exploration code which will scan 2 continuous candles. Like,

If a logic condition is met on a particular candle, then the logic condition of the next candle is checked, otherwise not.

Like, if a candle is created in red then only the next candles is checked if it is created in green.

Please help by your valuable suggestions.

Do you mean you want to get the closing price of the candles or the OHLC values?

As I have mentioned, I want to scan a candle with a (logic) condition, and if it returns "True", then the consecutive candle is scanned for another (logic) condition.

For an example, imagine like:

If RSI(14) > 70 is true for a candle then I want to check if RSI(14) > 75 is also true for the next consecutive candle or not

test = RSI(14) > 70 and Ref(RSI(14),-1) > 75;