Session Range captures the "initial balance" of one or more trading sessions - the high/low established during the opening window - and flags the first time price breaks out of that range after the window closes. It is the building block for opening-range-breakout (ORB) and DR/IDR session strategies.
Logic
For each configured session window the indicator:
- While the window is open, accumulates the running high/low (DR) and the running body high/low (IDR).
- When the window closes, freezes that range.
- For up to
breakout_window_barsbars after the close, watches for the first move beyond the frozen range. Withconfirm: closethe bar must close past the edge; withconfirm: wicka high/low touch is enough. The first qualifying move up marks a long breakout, the first down marks a short - one breakout per direction, per session.
DR uses wicks; IDR uses bodies, matching the LuxAlgo DR/IDR convention.
The bounded window matters: a frozen range goes stale quickly, so a breakout fired many hours later against an outdated range carries no edge. Keeping the window tight (and confirming on close) is what separates a real session breakout from chasing noise.
Params
range_type-dr(wicks) oridr(bodies). Drives both the emitted levels used for breakout detection.tz_offset_hours- shifts UTC candle timestamps into your session timezone so the windows line up with the real market clock.breakout_window_bars- bars after the session close during which a breakout may fire. Default 24. 0 disables the bound.confirm-close(close beyond the range, default) orwick(high/low touch).closeis far more robust.sessions- the session windows themselves (name +HHMM-HHMM). Defaults to London (1000-1100), New York (1500-1600), Sydney (2200-2300), and Tokyo (0200-0300) in the offset timezone. Edited in the strategy JSON.
Output
Eight columns, prefixed with your indicator name:
{name}_active- inside a session window right now{name}_complete- a session range has frozen and the window closed{name}_in_window- inside the post-session breakout window{name}_dr_high/{name}_dr_low- DR (wick) range bounds{name}_idr_high/{name}_idr_low- IDR (body) range bounds{name}_breakout_long- first long breakout this session{name}_breakout_short- first short breakout this session
Usage
Pair {name}_breakout_long / {name}_breakout_short as entry
triggers, and use {name}_dr_high / {name}_dr_low as the
breakout-execution levels so fills land at the range edge instead of
the bar close. A volatility stop (ATR) keyed off the range size is the
natural companion.
Pitfalls
- Set
tz_offset_hourscorrectly. Wrong offset shifts every session window and silently produces ranges at the wrong hours. - Prefer
confirm: close. Wick-pierce breakouts fire on the noise that immediately reverses; on BTC 15m this is the difference between a profitable and a ruinous config. - Don't stack many sessions. Four overlapping sessions produce a breakout setup every few hours and over-trade a weak edge. A single liquid session (e.g. the NY open) is usually the cleaner signal.
- One breakout per direction. A whipsaw that pierces both sides fires both a long and a short flag for that session - filter with a trend or bias condition if you only want one side.
