How it is calculated
The window runs from the open (hour and minute on the chosen clock, daylight saving included) for the set minutes, cut at local midnight, every local day. High and low are those of the bars that start inside it; mid is their mean, size their difference. size_atr is size divided by Wilder's ATR over the finished local days. position is 1 above the high, -1 below the low, 0 inside.
Reference: Opening range (Crabel 1990), on the zone's wall clock
How to read it
Nothing shows until the window has closed, at the close of the bar that reaches its end, so a strategy never acts on a range still forming; from local midnight it is empty again until the next window closes. A bar counts when it starts inside, so a 09:30 window needs M30 or finer. Frankfurt's 09:00 is 08:00 London, the same instant all year.
In a strategy
An opening range breakout: with r = ctx.ind("opening_range", zone="new_york", hour=9, minute=30, minutes=30) go long when r.position turns 1 and short when it turns -1, skipping days where r.size_atr is above 0.5.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Clockzone | Choice | "new_york" | UTC, London, New York, Tokyo, Sydney |
Open hourhour | Whole number | 9 | min 0, max 23 |
Open minuteminute | Whole number | 30 | min 0, max 59 |
Range minutesminutes | Whole number | 30 | min 1, max 1440 |
ATR daysatr_length | Whole number | 14 | min 1, max 200 |
What it draws
| Line | Drawn as |
|---|---|
| Range high | Steps |
| Range low | Steps |
| Range middle | Steps |
Used in
No strategy template reads it yet.