OPEN-SOURCE SCRIPT
Aggiornato

Opening Range Breakout (ORB) with Fib Retracement

2 235
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.

  • **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
minor
Note 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
  1. [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.
  2. [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.
  3. [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.
  4. [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”.
  5. [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.
  6. [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.
  7. [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.

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.