OPEN-SOURCE SCRIPT
Aggiornato ORB

ORB V2 plots the Opening Range Breakout for the Asia, London, or New York session, using the high and low of a selectable timeframe candle (1 to 240 min) captured at the exact session open in New York time.
What it draws:
High, midpoint (50%), and low lines of the opening range, extended live for the duration of the session
Color-coded labels showing the exact price of each level
A vertical opening marker at session start
Built-in bias filter:
A configurable EMA (default 20-period on the 1H timeframe, both adjustable) is calculated independently of the chart timeframe via request.security, and compared to price to display a simple Bullish/Bearish bias — useful for filtering ORB breakout trades in the direction of the higher-timeframe trend rather than trading every breakout blindly.
Dashboard:
A bottom-right table shows the total range size and the distance to the 50% level, converted into your choice of units (ticks, pips, or % for crypto), plus the previous day's high and low for additional context, and the current bias reading.
How to use it:
Select your session (Asia / London / NY) and the opening candle timeframe.
Watch for price to break above/below the ORB high/low.
Use the EMA bias reading to favor breakouts aligned with the higher-timeframe trend, and the 50% level as a mid-range reference for partial targets or re-entries.
Use the dashboard to gauge range size in your preferred unit before sizing a trade.
All colors, label sizes, and the dashboard display can be customized from the indicator settings.
What it draws:
High, midpoint (50%), and low lines of the opening range, extended live for the duration of the session
Color-coded labels showing the exact price of each level
A vertical opening marker at session start
Built-in bias filter:
A configurable EMA (default 20-period on the 1H timeframe, both adjustable) is calculated independently of the chart timeframe via request.security, and compared to price to display a simple Bullish/Bearish bias — useful for filtering ORB breakout trades in the direction of the higher-timeframe trend rather than trading every breakout blindly.
Dashboard:
A bottom-right table shows the total range size and the distance to the 50% level, converted into your choice of units (ticks, pips, or % for crypto), plus the previous day's high and low for additional context, and the current bias reading.
How to use it:
Select your session (Asia / London / NY) and the opening candle timeframe.
Watch for price to break above/below the ORB high/low.
Use the EMA bias reading to favor breakouts aligned with the higher-timeframe trend, and the 50% level as a mid-range reference for partial targets or re-entries.
Use the dashboard to gauge range size in your preferred unit before sizing a trade.
All colors, label sizes, and the dashboard display can be customized from the indicator settings.
Note di rilascio
ORB V2 ChangelogFIX 1 - Wrong range when viewing the chart on lower timeframes (M1/M3)
When the ORB was set to M15 but the chart was viewed on M1 or M3, the indicator was reading the high/low of the still-open candle on the chart's timeframe instead of the configured one. This produced an incorrect range that kept changing tick by tick until the candle closed, potentially causing real trading losses. The root cause was that request.security without [1] returns the candle that has not closed yet. The fix was to add [1] to both high and low in the security call, so the indicator always reads the already closed candle of the configured timeframe, regardless of what timeframe the chart is set to.
FIX 2 - ORB range being recaptured multiple times on lower timeframes
On M1 and M3 charts, multiple bars fall within the same opening minute. The original condition used to detect the opening bar was failing in those cases, causing orbHigh and orbLow to be overwritten multiple times with partial candle values. The fix was to replace that condition with a boolean flag called orbCaptured that guarantees the range is captured only once per day. The flag resets automatically at the start of each new trading session, so no manual intervention is needed.
Improvement - Price labels removed from the chart
The High, 50% and Low price labels that used to float on the chart have been removed. All that information is still available in the dashboard in the bottom right corner of the chart. This keeps the layout cleaner, especially on lower timeframes where the labels were overlapping with price action.
Improvement - New Points unit added to the dashboard
The Pips unit was designed for standard 5-decimal forex pairs and used an internal divisor that produced incorrect values on instruments like Gold (XAUUSD) and indices like NAS100. A new Points option has been added to the unit selector in the dashboard settings. It returns the raw price difference with no conversion, which matches exactly what any execution platform like Quantower displays. For Gold and index CFDs, Points is now the recommended unit. For standard forex pairs, Pips remains the right choice. Ticks is always available as a universal fallback that works correctly on any instrument.
Note di rilascio
ORB V2 — Update v2.1 | Bug Fix: Incorrect RangeFixed a bug where the ORB high/low levels displayed differently depending on the chart timeframe (e.g. M1 vs M5 showed different ranges when they should be identical).
Root cause: the indicator was using request.security() with an external timeframe to read the opening candle's high/low, which caused misalignment between timeframes.
Fix: replaced with a native bar-by-bar accumulator that runs directly on the chart's timeframe, capturing the exact high/low at the close of the first session candle — consistent across all timeframes.
No settings changes needed. Just update the script and refresh your chart.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.