OPEN-SOURCE SCRIPT
8:00-8:15 ORB Retest on 5m Time Frame v1.3 by Alf_Algo

ORB Retest on 5m Time Frame
Breakout → Retest → Confirm → Enter
A structured session indicator designed to trade continuation after an opening range breakout using midpoint retests and confirmation.
The system avoids chasing breakouts and instead waits for price acceptance and momentum confirmation.
━━━━━━━━━━━━━━━━━━━━━━━━
Timeframe
Pine Script®
Designed exclusively for the 5-minute chart.
The opening range is built using the first three 5-minute candles.
━━━━━━━━━━━━━━━━━━━━━━━━
Opening Range Levels
The midpoint acts as the primary retest level for entries.
━━━━━━━━━━━━━━━━━━━━━━━━
Breakout Direction Mode (New in v1.2)
Four modes to determine how directional bias is set after the opening range:
For Last Break and Strongest Break modes, triangle markers appear on the chart each time the bias flips, so you can visually track the tug-of-war between bulls and bears before the entry window.
━━━━━━━━━━━━━━━━━━━━━━━━
Bias Logic
Depending on the selected Breakout Direction Mode, the bias may lock on the first break, update with subsequent breaks, follow the strongest candle body, or be manually chosen.
━━━━━━━━━━━━━━━━━━━━━━━━
Entry Logic
Three confirmation modes are available:
━━━━━━━━━━━━━━━━━━━━━━━━
Risk Management — Triple TP System (New in v1.2)
Three take-profit levels are automatically calculated using ATR, all shown on the chart from the moment a signal fires:
Each TP and SL level gets a label when hit (TP1 ✓, TP2 ✓, TP3 ✓, SL ✗), so you can see exactly where targets were reached or where the stop was triggered. All ATR multipliers are fully adjustable in the settings.
Alert conditions are available for each individual TP hit and SL hit.
━━━━━━━━━━━━━━━━━━━━━━━━
Chart Elements
━━━━━━━━━━━━━━━━━━━━━━━━
Dashboard
The on-chart dashboard displays real-time state:
━━━━━━━━━━━━━━━━━━━━━━━━
Typical Workflow
━━━━━━━━━━━━━━━━━━━━━━━━
v1.2 Release Notes
v1.1 Release Notes
━━━━━━━━━━━━━━━━━━━━━━━━
Feedback
This script is shared publicly to help traders study structured opening range continuation setups.
Breakout → Retest → Confirm → Enter
A structured session indicator designed to trade continuation after an opening range breakout using midpoint retests and confirmation.
- Opening Range defines session structure
- Breakout sets directional bias (with multiple detection modes)
- Midpoint retest provides entry location
- Momentum confirmation triggers signals
- Triple ATR-based TP levels and structure-based SL manage risk
The system avoids chasing breakouts and instead waits for price acceptance and momentum confirmation.
━━━━━━━━━━━━━━━━━━━━━━━━
Timeframe
Pine Script®
Designed exclusively for the 5-minute chart.
The opening range is built using the first three 5-minute candles.
━━━━━━━━━━━━━━━━━━━━━━━━
Opening Range Levels
- OR High — upper boundary (teal)
- OR Low — lower boundary (red)
- OR Midpoint — primary retest level (amber, dashed)
- Shaded zone between High and Low for visual clarity
The midpoint acts as the primary retest level for entries.
━━━━━━━━━━━━━━━━━━━━━━━━
Breakout Direction Mode (New in v1.2)
Four modes to determine how directional bias is set after the opening range:
- First Break — original behavior; whichever direction breaks out first locks the bias
- Last Break — bias updates with each new breakout before the entry window opens, capturing the final sentiment
- Strongest Break — the breakout with the largest candle body wins; more conviction = more significant
- Directional Preference — manually select Bullish or Bearish; bias is set when the OR locks regardless of price action
For Last Break and Strongest Break modes, triangle markers appear on the chart each time the bias flips, so you can visually track the tug-of-war between bulls and bears before the entry window.
━━━━━━━━━━━━━━━━━━━━━━━━
Bias Logic
- Close above OR High → Bullish Bias
- Close below OR Low → Bearish Bias
Depending on the selected Breakout Direction Mode, the bias may lock on the first break, update with subsequent breaks, follow the strongest candle body, or be manually chosen.
━━━━━━━━━━━━━━━━━━━━━━━━
Entry Logic
- Wait for midpoint retest
- Require confirmation
- Signal triggers within the active session window
Three confirmation modes are available:
- Retest Close Reclaim
- Break Retest Candle
- Hybrid (default)
━━━━━━━━━━━━━━━━━━━━━━━━
Risk Management — Triple TP System (New in v1.2)
Three take-profit levels are automatically calculated using ATR, all shown on the chart from the moment a signal fires:
- TP1 — 2× ATR (default) — solid line
- TP2 — 3× ATR (default) — dashed line
- TP3 — 5× ATR (default) — dotted line
- SL — structure-based, remains fixed throughout the trade
Each TP and SL level gets a label when hit (TP1 ✓, TP2 ✓, TP3 ✓, SL ✗), so you can see exactly where targets were reached or where the stop was triggered. All ATR multipliers are fully adjustable in the settings.
Alert conditions are available for each individual TP hit and SL hit.
━━━━━━━━━━━━━━━━━━━━━━━━
Chart Elements
- Opening Range High / Low / Mid with shaded zone
- Breakout markers (triangles)
- Retest markers (diamonds)
- Buy / Sell signal labels
- TP1 / TP2 / TP3 and SL levels with hit labels
- On-chart dashboard with full state tracking
━━━━━━━━━━━━━━━━━━━━━━━━
Dashboard
The on-chart dashboard displays real-time state:
- Session preset
- Breakout Direction Mode
- First break direction
- Current bias
- Retest status
- Signal status
- Confirmation mode
- Individual TP1 / TP2 / TP3 and SL hit status
- TP ATR multiplier values
━━━━━━━━━━━━━━━━━━━━━━━━
Typical Workflow
- Apply on a 5-minute chart
- Select your session and breakout direction mode
- Allow opening range to form
- Observe breakout(s) and bias assignment
- Wait for midpoint retest
- Enter after confirmation
- Monitor TP1 → TP2 → TP3 progression
━━━━━━━━━━━━━━━━━━━━━━━━
v1.2 Release Notes
- Added Breakout Direction Mode with four options: First Break, Last Break, Strongest Break, Directional Preference
- Added triple take-profit system (TP1, TP2, TP3) with independent ATR multipliers
- TP and SL hit labels appear on chart when each level is reached
- Added alert conditions for each TP hit and SL hit
- Styled OR lines with updated color palette (teal / red / amber)
- Added shaded zone between OR High and Low
- Updated dashboard with Breakout Direction Mode, individual TP status, and ATR multiplier display
v1.1 Release Notes
- Added ORB session selection (New York, London, Asia)
- Replaced breakout text labels with directional triangle icons
- Replaced retest text labels with diamond icons
- Added on-chart dashboard
- Dashboard now shows directional state instead of checkmarks
- Added Buy / Sell signal display in dashboard
- Added color-coded dashboard values (green bullish, red bearish)
- Updated Buy/Sell signal label colors
- Added TP / SL outcome tracking in dashboard
━━━━━━━━━━━━━━━━━━━━━━━━
Feedback
This script is shared publicly to help traders study structured opening range continuation setups.
- Feedback and suggestions are welcome
- Ideas for improvements or additional features are appreciated
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。