Determining operating range is critical for trading.
You *need* to sell in premium & buy in discount.
This script determines an operating range by stepping back on an HTF timeframe to calculate that HTF candle's range. If the current candle in HTF breaks out, the range expands accordingly.
The timeframe mapping I've used is
Intraday & <= 2H : use Daily as...