OPEN-SOURCE SCRIPT
Actualizado IrishGOD (ORB)

Opening Range Breakout (ORB) Indicator — Professional Description
Pine Script v5 Overlay Indicator Intraday
Opening Range Breakout (ORB)
A precision intraday indicator that defines the high and low of a configurable opening range window, locks those levels once the window expires, and flags the first directional breakout of the day with a clear visual signal directly on the chart.
Overview
The Opening Range Breakout strategy is one of the most widely used frameworks in active intraday and momentum trading. The theory holds that the high and low established during the first N minutes of a session represent a market structure boundary — a zone of price discovery where institutional and retail participants alike are establishing positions. A decisive break above or below this range often signals the direction of the day's dominant trend.
This indicator automates the entire process: it watches price during the formation window, locks the range the instant the window closes, draws clean reference lines, and marks the first breakout in each direction with a non-cluttering arrow label — without requiring any manual input from the trader after initial setup.
Core logic
Phase 1 — Range formation
From the configured session open time, the indicator tracks the rolling high and low of every bar within the ORB window. No lines are drawn yet; the range is still live and expanding with each new bar.
Phase 2 — Range lock
On the first bar after the ORB window closes, the high and low are frozen. Two horizontal lines are drawn from that exact bar extending forward for the remainder of the session. The range will not change again for the rest of the day.
Phase 3 — Bullish breakout signal
If price closes above the ORB High after the window has locked, a green upward arrow is plotted below the breakout candle. This signal fires only once per day — the first confirmed close above the range.
Phase 4 — Bearish breakout signal
If price closes below the ORB Low after the window has locked, a red downward arrow is plotted above the breakout candle. Like the bullish signal, this fires once per day on first confirmed close below the range.
Configuration parameters
Parameter Default Description
Session Start Hour 9 Hour of day (24-hour format) when the session opens and ORB formation begins. Adjust for futures, forex, or international markets.
Session Start Minute 30 Minute offset within the start hour. Combined with the hour input, defines the exact session open (default: 9:30 for US equities).
ORB Duration 30 min How many minutes the range formation window remains open. Common settings are 5, 15, 30, and 60 minutes. Accepts 1–240 minutes.
Range High Line Color Teal Color of the horizontal ORB High reference line. Fully customizable via the TradingView color picker.
Range Low Line Color Orange Color of the horizontal ORB Low reference line. Distinct from the high to allow instant visual separation at a glance.
Line Width 1 Thickness of the range lines in pixels. Range of 1–4. Useful for scaling visibility on higher-resolution monitors.
Arrow Size small Controls the rendered size of breakout arrow labels. Options: tiny, small, normal, large. Sized to avoid obscuring surrounding price action.
Extend Lines true When enabled, range lines extend 500 bars to the right — effectively to the right edge of the visible chart. Disable to limit lines to ~390 bars (standard session length).
Enable Alerts false When enabled, fires a TradingView alert on the first bullish or bearish breakout of each session. Compatible with webhooks, email, and push notifications.
Visual features
Formation Window
Yellow background tint
A subtle highlight shades the candles within the ORB formation window so you can immediately see which bars contributed to the range definition.
Reference Lines
Clean horizontal levels
Single solid lines mark the ORB High and Low from the moment the window closes, extending forward without visual clutter. Previous day's lines are removed automatically.
Breakout Arrows
Directional label markers
Arrow labels are offset from price using ATR(14) so they never overlap the candle body or wick. Transparent backgrounds keep the chart unobstructed.
Data Window
ORB level readout
Once the range is locked, the exact ORB High and Low values appear in TradingView's Data Window panel for precise reference at any bar.
Compatibility
The indicator is designed for intraday timeframes — it is most effective on charts from 1-minute through 30-minute bars. It will not produce signals on daily or higher timeframes, as the ORB window logic depends on intraday time-of-day calculations.
The session start time defaults to 9:30 AM ET for US equity and ETF markets. For futures markets (ES, NQ, CL), crypto, or forex, adjust the start hour and minute to match the relevant session open.
US Equities
ETFs
Equity Futures
Crypto
Forex
Commodities
Installation
Open the Pine Script Editor in TradingView, paste the full source code, click Save, then click Add to chart. The indicator will appear immediately on the active chart. All inputs are accessible via the gear icon in the indicator title bar.
Pine Script v5 Overlay Indicator Intraday
Opening Range Breakout (ORB)
A precision intraday indicator that defines the high and low of a configurable opening range window, locks those levels once the window expires, and flags the first directional breakout of the day with a clear visual signal directly on the chart.
Overview
The Opening Range Breakout strategy is one of the most widely used frameworks in active intraday and momentum trading. The theory holds that the high and low established during the first N minutes of a session represent a market structure boundary — a zone of price discovery where institutional and retail participants alike are establishing positions. A decisive break above or below this range often signals the direction of the day's dominant trend.
This indicator automates the entire process: it watches price during the formation window, locks the range the instant the window closes, draws clean reference lines, and marks the first breakout in each direction with a non-cluttering arrow label — without requiring any manual input from the trader after initial setup.
Core logic
Phase 1 — Range formation
From the configured session open time, the indicator tracks the rolling high and low of every bar within the ORB window. No lines are drawn yet; the range is still live and expanding with each new bar.
Phase 2 — Range lock
On the first bar after the ORB window closes, the high and low are frozen. Two horizontal lines are drawn from that exact bar extending forward for the remainder of the session. The range will not change again for the rest of the day.
Phase 3 — Bullish breakout signal
If price closes above the ORB High after the window has locked, a green upward arrow is plotted below the breakout candle. This signal fires only once per day — the first confirmed close above the range.
Phase 4 — Bearish breakout signal
If price closes below the ORB Low after the window has locked, a red downward arrow is plotted above the breakout candle. Like the bullish signal, this fires once per day on first confirmed close below the range.
Configuration parameters
Parameter Default Description
Session Start Hour 9 Hour of day (24-hour format) when the session opens and ORB formation begins. Adjust for futures, forex, or international markets.
Session Start Minute 30 Minute offset within the start hour. Combined with the hour input, defines the exact session open (default: 9:30 for US equities).
ORB Duration 30 min How many minutes the range formation window remains open. Common settings are 5, 15, 30, and 60 minutes. Accepts 1–240 minutes.
Range High Line Color Teal Color of the horizontal ORB High reference line. Fully customizable via the TradingView color picker.
Range Low Line Color Orange Color of the horizontal ORB Low reference line. Distinct from the high to allow instant visual separation at a glance.
Line Width 1 Thickness of the range lines in pixels. Range of 1–4. Useful for scaling visibility on higher-resolution monitors.
Arrow Size small Controls the rendered size of breakout arrow labels. Options: tiny, small, normal, large. Sized to avoid obscuring surrounding price action.
Extend Lines true When enabled, range lines extend 500 bars to the right — effectively to the right edge of the visible chart. Disable to limit lines to ~390 bars (standard session length).
Enable Alerts false When enabled, fires a TradingView alert on the first bullish or bearish breakout of each session. Compatible with webhooks, email, and push notifications.
Visual features
Formation Window
Yellow background tint
A subtle highlight shades the candles within the ORB formation window so you can immediately see which bars contributed to the range definition.
Reference Lines
Clean horizontal levels
Single solid lines mark the ORB High and Low from the moment the window closes, extending forward without visual clutter. Previous day's lines are removed automatically.
Breakout Arrows
Directional label markers
Arrow labels are offset from price using ATR(14) so they never overlap the candle body or wick. Transparent backgrounds keep the chart unobstructed.
Data Window
ORB level readout
Once the range is locked, the exact ORB High and Low values appear in TradingView's Data Window panel for precise reference at any bar.
Compatibility
The indicator is designed for intraday timeframes — it is most effective on charts from 1-minute through 30-minute bars. It will not produce signals on daily or higher timeframes, as the ORB window logic depends on intraday time-of-day calculations.
The session start time defaults to 9:30 AM ET for US equity and ETF markets. For futures markets (ES, NQ, CL), crypto, or forex, adjust the start hour and minute to match the relevant session open.
US Equities
ETFs
Equity Futures
Crypto
Forex
Commodities
Installation
Open the Pine Script Editor in TradingView, paste the full source code, click Save, then click Add to chart. The indicator will appear immediately on the active chart. All inputs are accessible via the gear icon in the indicator title bar.
Notas de prensa
Updated to show multiple signals and not just the first breaks. This should help highlight multiple breaks in lower timeframes. Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.