OPEN-SOURCE SCRIPT
Opening Range Breakout (ORB) [martineye15]

Opening Range Breakout (ORB) — a configurable, non-repainting opening-range breakout tool. It records the high and low of an opening-range window you define, locks that range at session close, then signals breakouts above or below it and projects a stop-loss and up to three take-profit targets for each one. It is market-agnostic: session, timezone, active days, confirmation style, risk model, filters, visuals and alerts are all inputs, so the same tool adapts to indices, futures, forex, crypto or stocks on any intraday timeframe.
THE OPENING RANGE
- Define the range by session time and timezone (e.g. 0930-0945 New York for the first 15 minutes of the US cash open), with presets for the major world market zones.
- Choose which weekdays are active (Mon to Sun).
- The range builds live during the window, then locks at session close. Optionally extend the locked levels across the rest of the day.
BREAKOUT DETECTION
- Confirmation: require a bar to close beyond the level, or count any wick / touch.
- Signal mode: the first breakout of the day only, or every breakout.
- Optional retest: after the initial break, wait for price to return to the broken level and resume in the breakout direction before signalling.
RISK MODEL
- Stop-loss: opposite OR boundary, OR midpoint, ATR, fixed ticks, or percent.
- Take-profit: risk multiple (R), OR-range multiple, ATR, fixed ticks, or percent, with up to three targets.
- Levels are computed from the entry, drawn with labels, and their hits are tracked bar by bar.
FILTERS
- OR size filter: skip days whose range is too small or too large (in ticks or percent) to avoid low-quality sessions.
- One trade per day.
- Volume confirmation: require the breakout bar's volume to exceed its moving average.
VISUALS & INFO
- Opening-range box and high/low lines, breakout labels, and SL/TP lines, all with configurable colours, width and style.
- Optional session background, and an on-chart info table showing the OR high/low, range size, current state (forming / waiting / filtered / active / closed) and the latest result.
ALERTS
- Opening range formed, bullish breakout, bearish breakout, take-profit hit, and stop-loss hit, with messages that include the symbol, timeframe and levels.
HOW TO USE
Apply it to an intraday chart and set the OR session and timezone to match your instrument — the US cash open, a forex session open, or any window you trade. Tune the stop and target model to your risk approach, add the size, volume or one-trade-per-day filters if you want stricter conditions, and set alerts on the events you care about. Every module toggles independently, so you can keep the chart minimal or fully detailed.
WHAT MAKES IT DIFFERENT
Rather than a fixed opening-range window with a single stop and target rule, everything is parameterised: five stop methods, five target methods with up to three targets, an optional retest condition, size and volume filters, and full timezone / session / weekday control — so one tool fits very different instruments and playbooks while staying non-repainting.
REPAINTING & LIMITATIONS
Breakout signals and stop/target hits are evaluated only on confirmed (closed) bars, so historical and realtime behaviour match — the tool does not repaint. The opening-range box and lines update live while the range is still forming, which is expected. It runs on intraday timeframes only; on daily or higher it displays a notice instead of drawing.
This is a visual, decision-support tool. It is not a strategy, it places no orders and reports no performance statistics, and it is not financial advice.
THE OPENING RANGE
- Define the range by session time and timezone (e.g. 0930-0945 New York for the first 15 minutes of the US cash open), with presets for the major world market zones.
- Choose which weekdays are active (Mon to Sun).
- The range builds live during the window, then locks at session close. Optionally extend the locked levels across the rest of the day.
BREAKOUT DETECTION
- Confirmation: require a bar to close beyond the level, or count any wick / touch.
- Signal mode: the first breakout of the day only, or every breakout.
- Optional retest: after the initial break, wait for price to return to the broken level and resume in the breakout direction before signalling.
RISK MODEL
- Stop-loss: opposite OR boundary, OR midpoint, ATR, fixed ticks, or percent.
- Take-profit: risk multiple (R), OR-range multiple, ATR, fixed ticks, or percent, with up to three targets.
- Levels are computed from the entry, drawn with labels, and their hits are tracked bar by bar.
FILTERS
- OR size filter: skip days whose range is too small or too large (in ticks or percent) to avoid low-quality sessions.
- One trade per day.
- Volume confirmation: require the breakout bar's volume to exceed its moving average.
VISUALS & INFO
- Opening-range box and high/low lines, breakout labels, and SL/TP lines, all with configurable colours, width and style.
- Optional session background, and an on-chart info table showing the OR high/low, range size, current state (forming / waiting / filtered / active / closed) and the latest result.
ALERTS
- Opening range formed, bullish breakout, bearish breakout, take-profit hit, and stop-loss hit, with messages that include the symbol, timeframe and levels.
HOW TO USE
Apply it to an intraday chart and set the OR session and timezone to match your instrument — the US cash open, a forex session open, or any window you trade. Tune the stop and target model to your risk approach, add the size, volume or one-trade-per-day filters if you want stricter conditions, and set alerts on the events you care about. Every module toggles independently, so you can keep the chart minimal or fully detailed.
WHAT MAKES IT DIFFERENT
Rather than a fixed opening-range window with a single stop and target rule, everything is parameterised: five stop methods, five target methods with up to three targets, an optional retest condition, size and volume filters, and full timezone / session / weekday control — so one tool fits very different instruments and playbooks while staying non-repainting.
REPAINTING & LIMITATIONS
Breakout signals and stop/target hits are evaluated only on confirmed (closed) bars, so historical and realtime behaviour match — the tool does not repaint. The opening-range box and lines update live while the range is still forming, which is expected. It runs on intraday timeframes only; on daily or higher it displays a notice instead of drawing.
This is a visual, decision-support tool. It is not a strategy, it places no orders and reports no performance statistics, and it is not financial advice.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Custom TradingView indicators & strategies in Pine Script — Smart Money Concepts / ICT specialist. Available for freelance work: martineye15@gmail.com
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Custom TradingView indicators & strategies in Pine Script — Smart Money Concepts / ICT specialist. Available for freelance work: martineye15@gmail.com
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.