OPEN-SOURCE SCRIPT
업데이트됨 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.
릴리즈 노트
minor릴리즈 노트
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.릴리즈 노트
- [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.
릴리즈 노트
- 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.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.