ORB (Opening Range)¶
The high and low of the first minutes after a market session opens (the "opening range"). ORH is the range high, ORL the range low and ORM the middle, halfway between them ((ORH + ORL) / 2).
Settings¶
| Setting | Default | What it does |
|---|---|---|
| Session | New York (09:30) | Which open the range starts at. New York (09:30), London (08:00) and Tokyo (09:00) start at that exchange's opening time in local time, Monday to Friday, and follow daylight saving. Fixed UTC time starts at the Start time below, every day. |
| Start (minutes after 00:00 UTC) | 810 | Only used with Fixed UTC time: when the window starts, in minutes after 00:00 UTC (810 = 13:30 UTC). From 0 to 1439. |
| Range minutes | 30 | How long the window is, from 5 to 240 minutes. A longer window gives a wider range, so breakouts are rarer and come later in the session. |
| Kept | Until the next range is complete | How long a day's range stays in use. Until the next range is complete (next_range, the default): the previous range stays in use while the next one forms, and is replaced when the next window ends. Until the next open (session_open): the range ends when the next window starts, so there is no range until today's is complete; use this to trade only today's range from the open. |
Ready-made conditions¶
| For | Condition | Fires when |
|---|---|---|
| Buy | Price crosses above the opening range high | the one candle price moves from below the ORH line to above it |
| Buy | Price above the opening range high | every candle price is above the ORH line |
| Buy | Price crosses below the opening range middle | the one candle price moves from above the ORM line to below it |
| Sell | Price crosses below the opening range low | the one candle price moves from above the ORL line to below it |
| Sell | Price below the opening range low | every candle price is below the ORL line |
| Sell | Price crosses above the opening range middle | the one candle price moves from below the ORM line to above it |
"Crosses below the opening range middle" (Buy) and "crosses above the opening range middle" (Sell) are meant as exits: price falling back inside the range.
Warnings¶
- "… uses a 30-minute opening range from … on … candles, which do not line up with that window, so the range is never available. Use a shorter timeframe that fits the window (for example 5m).": the condition's timeframe does not divide both Range minutes and the window's start time, so there is never a range. Pick a shorter timeframe (for example 5m for a 30-minute range). You can still save it.
- Blocks Save: Start (minutes after 00:00 UTC) 0–1439; Range minutes 5–240; Session one of New York (09:30), London (08:00), Tokyo (09:00), Fixed UTC time; Kept one of Until the next range is complete, Until the next open.
Good to know¶
- Uses each candle's high and low, not the close.
- When it is there: a day's range appears on the first candle that opens when the window ends, so it never uses prices from before they happened. How long it then stays depends on Kept:
- Until the next range is complete (default,
next_range): it stays until the next day's window closes. With this setting, while today's window is running ORH, ORL and ORM are still the previous day's values, so a condition like "price above the opening range high" can trade on the previous day's range during that time. - Until the next open (
session_open): it stays until the next day's window starts. While today's window is running there is no range, so no condition on it can fire until today's range is complete. The library's Session Opening-Range Breakout uses this.
- Until the next range is complete (default,
- Use candles that fit the window. The candle interval must divide both Range minutes and the window's start time: 5m candles fit a 30-minute range from 09:30, 15m candles fit 30 minutes but not 5 or 20. If they do not fit there is no range at all (see the warning above).
- Missing candles: if any candle inside the window is missing, there is no range that day.
- Weekends: New York, London and Tokyo only have a range Monday to Friday (on the exchange's local dates). Friday's range ends at Saturday 00:00 in the session's time zone, and there is no range again until Monday's window closes. Fixed UTC time runs every day, and its window can cross midnight UTC.
- Holidays: there is no holiday calendar, so exchange holidays still produce a range like any other weekday.
- Needs one day plus two windows of candles (301 candles on 5m with a 30-minute range).