OPEN-SOURCE SCRIPT
Aggiornato Opening Range Breakout (ORB) with Fib Retracement

Overview
“ORB with Fib Retracement” is a Pine Script indicator that anchors a full Fibonacci framework to the first minutes of the trading day (the opening-range breakout, or ORB).
After the ORB window closes the script:
Locks-in that session’s high and low.
Calculates a complete ladder of Fibonacci retracement levels between them (0 → 100 %).
Projects symmetric extension levels above and below the range (±1.618, ±2.618, ±3.618, ±4.618 by default).
Sub-divides every extension slice with additional 23.6 %, 38.2 %, 50 %, 61.8 % and 78.6 % mid-lines so each “zone” has its own inner fib grid.
Plots the whole structure and—optionally—extends every line into the future for ongoing reference.
“ORB with Fib Retracement” is a Pine Script indicator that anchors a full Fibonacci framework to the first minutes of the trading day (the opening-range breakout, or ORB).
After the ORB window closes the script:
Locks-in that session’s high and low.
Calculates a complete ladder of Fibonacci retracement levels between them (0 → 100 %).
Projects symmetric extension levels above and below the range (±1.618, ±2.618, ±3.618, ±4.618 by default).
Sub-divides every extension slice with additional 23.6 %, 38.2 %, 50 %, 61.8 % and 78.6 % mid-lines so each “zone” has its own inner fib grid.
Plots the whole structure and—optionally—extends every line into the future for ongoing reference.
- **Session time / timezone** – Defines the ORB window (defaults 09:30–09:45 EST).
- **Show All Fib Levels** – Toggles every retracement and extension line on or off.
- **Show Extended Lines** – Draws dotted, extend-right projections of every level.
- **Color group** – Assigns colors to buy-side (green), sell-side (red), and internal fibs (gray).
- **Extension value inputs** – Allows custom +/- 1.618 to 4.618 fib levels for personalized projection zones.
Note di rilascio
minorNote di rilascio
Added all necessary half-hour offsets (e.g., GMT+5:30, GMT-3:30) to the existing full-hour GMT list, covering the full range from GMT-12 to GMT+14. This allows for accurate session alignment in regions with 30-minute time differences.Note di rilascio
- [B]What makes this tool different[/B] – Most ORB scripts stop at the breakout line or show a single-direction retracement. This one builds a [B]complete, symmetrical Fibonacci “ladder”[/B] (0 → 4.618 and −0 → −4.618) from the opening-range high and low, so traders can read both pull-backs and extensions with the same visual grammar.
- [B]Core idea[/B] – Price often “respects” the opening 15-minute range; measuring every Fib proportion above [I]and[/I] below that zone creates objective checkpoints for intraday continuation, fade and mean-reversion plays.
- [B]How the maths work[/B]
• Session picker grabs your custom window (default 09 : 30–09 : 45 New-York).
• First bar after the window freezes the range; subsequent bars update a cached [I]finalTop/finalLow[/I].
• A single array holds the positive and negative Fib coefficients.
• A helper routine translates each coefficient into an absolute price, returning eight nested “rings” of levels (both sides of the range, plus mid-steps between the 1×, 1.618×, 2.618×, 3.618×, 4.618× zones).
• Optional extender draws the same prices straight through to the next trading day, so you can see whether a level “matters” hours later. - [B]Visual logic[/B] – Green levels = upside targets; red = downside; grey = neutral Fib (23.6 → 78.6 %). Turn off “Show All Fib levels” if you only want the range and the ±1.618 “sweet-spot”.
- [B]Inputs you can tweak[/B]
• [I]Range[/I] & [I]Zone[/I] – any session / any timezone.
• Individual Fib coefficients for 1.618 → 4.618 and −1.618 → −4.618 (leave blank to disable).
• Two visibility switches: showAllLevels (on-chart clutter control) and showExtendedLines (project to next day).
• Three colour pickers for fast palette changes. - [B]Practical ways to trade it[/B]
• [I]Momentum breakout[/I] – wait for a candle close beyond ±1 × range, then trail partials at 1.618 / 2.618.
• [I]Fade the extremes[/I] – look for exhaustion signals at 3.618 / 4.618; stop outside the furthest band.
• [I]Reversion ladder[/I] – when price drops back inside the range, scale in/out at the grey Fib rungs.
• Pair with volume or oscillator divergence to filter false prints. - [B]Best-practice tips[/B] – Works on any intraday symbol but the structure is most reliable on liquid equities, index futures and majors. For very fast charts (<1 min) tighten the session (e.g., 09 : 30–09 : 35) to avoid level congestion.
Note di rilascio
- What makes this tool different – Most ORB scripts stop at the breakout line or show a single-direction retracement. This one builds a complete, symmetrical Fibonacci “ladder” (0 → 4.618 and −0 → −4.618) from the opening-range high and low, so traders can read both pull-backs and extensions with the same visual grammar.
- Core idea – Price often “respects” the opening 15-minute range; measuring every Fib proportion above and below that zone creates objective checkpoints for intraday continuation, fade and mean-reversion plays.
- How the maths work
• Session picker grabs your custom window (default 09 : 30–09 : 45 New-York).
• First bar after the window freezes the range; subsequent bars update a cached finalTop/finalLow.
• A single array holds the positive and negative Fib coefficients.
• A helper routine translates each coefficient into an absolute price, returning eight nested “rings” of levels (both sides of the range, plus mid-steps between the 1×, 1.618×, 2.618×, 3.618×, 4.618× zones).
• Optional extender draws the same prices straight through to the next trading day, so you can see whether a level “matters” hours later. - Visual logic – Green levels = upside targets; red = downside; grey = neutral Fib (23.6 → 78.6 %). Turn off “Show All Fib levels” if you only want the range and the ±1.618 “sweet-spot”.
- Inputs you can tweak
• Range & Zone – any session / any timezone.
• Individual Fib coefficients for 1.618 → 4.618 and −1.618 → −4.618 (leave blank to disable).
• Two visibility switches: showAllLevels (on-chart clutter control) and showExtendedLines (project to next day).
• Three colour pickers for fast palette changes. - Practical ways to trade it
• Momentum breakout – wait for a candle close beyond ±1 × range, then trail partials at 1.618 / 2.618.
• Fade the extremes – look for exhaustion signals at 3.618 / 4.618; stop outside the furthest band.
• Reversion ladder – when price drops back inside the range, scale in/out at the grey Fib rungs.
• Pair with volume or oscillator divergence to filter false prints. - Best-practice tips – Works on any intraday symbol but the structure is most reliable on liquid equities, index futures and majors. For very fast charts (<1 min) tighten the session (e.g., 09 : 30–09 : 35) to avoid level congestion.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.