I was trying to create an ORB on the upside for the 1st 2-hour candle. But in the indicator, ORB is only for showing the 1-hour candle. How to code for this?
You can use the combination of the Max function and the Nth candle function for your requirement. I have created a strategy as an example for your requirement. Click on the below link to view the strategy conditions.
The above strategy will generate an entry trigger when a 5min candle crosses above the highest high of the 1st two, 1-hour candles (i.e. the opening 2-hour candle). Refer to the below links to learn about the functions used.
Max - Create (Advanced) - Streak Help
Nth candle - Indicators - Streak Help
Hope this helps.