Pine editor code

Job ID: 33375208

Budget: ₹600 – ₹1,500 INR

want's a custom opening range based on the Color of the candlestick.

Ex. suppose the day starts with a green candle and the second candle is red. then whatever the high and low of that range i called the opening range.

Is it not necessary that the second candle should be an opposite color candle. it might be 2~3 candle in same color and then opposit color appear.

Means i need a day range of first opositsite color candle.
Related categories: Coding Pine Script Trading