INVITE-ONLY SCRIPT
Break & Retest of ORB (Backtesting)

Break & Retest v4.5 — What it does
Goal: Trade a single “break + retest” of the configurable Opening Range (OR) during a specific time window, with clean risk/return control and optional volume and side filters.
1) Define today’s Opening Range
2) Detect the first clean break
3) Wait for the retest (entry signal)
Inside that window:
4) Invalidation (one-time alert)
5) Risk & reward
6) Limits and session management
7) Visuals & alerts
Goal: Trade a single “break + retest” of the configurable Opening Range (OR) during a specific time window, with clean risk/return control and optional volume and side filters.
1) Define today’s Opening Range
- You choose the OR start time (Eastern Time) and the OR length in minutes (e.g., 9:30–9:45 ET).
- At the first bar of that OR window (on the chosen OR resolution), the script captures:
- Range High (ORH) and Range Low (ORL).
- The OR is drawn with configurable line and fill colors.
2) Detect the first clean break
- After the OR is set, the script waits for the first breakout past ORH or ORL.
- The break must move at least minBreakPts and at most maxBreakPts beyond the boundary (keeps out tiny pokes and runaway moves).
- If price first breaks above ORH, we mark a bullish break.
- If price first breaks below ORL, we mark a bearish break.
3) Wait for the retest (entry signal)
- From the breakout bar, a retest window opens for a fixed number of 1-minute bars: between minRetestBars and maxRetestBars.
Inside that window:
- Long setup (after bullish break): we require a bar whose low trades back into the range (between ORL and ORH). That is the “retest”.
- Short setup (after bearish break): we require a bar whose high trades back into the range.
- Entries can be restricted to a custom entry time window (ET) and optionally gated by a minimum volume.
- You can enable/disable longs or shorts independently.
4) Invalidation (one-time alert)
- If a bullish break later sees price dip below ORL, or a bearish break later sees price pop above ORH, the script flags a “First Invalidation” and prints a label once (with the reason).
- This is informational; it doesn’t auto-lock the system, but it’s a strong “structure broken” signal.
5) Risk & reward
- Stop loss (points) can be:
- Default: (ORH − ORL) + 1 point, capped at stopLossCap, or
- Custom fixed number of points.
- Take profit (points) can be:
- Default: RR × SL (not less than minTPpts), or
- Custom fixed (capped by maxTPpts logic in the input).
- When a trade fires, the script draws risk/reward boxes from the entry candle forward and (optionally) shows live R:R labels updating over time.
6) Limits and session management
- Daily entry cap: At most maxRetestsPerDay retest entries per day.
- Forced exit: Close any open position at a custom ET time (e.g., 12:00 ET).
- Daily reset: At 00:00 ET, the strategy resets its internal state for the new session (drawings remain on the chart).
7) Visuals & alerts
- OR high/low lines and the fill are color-configurable.
- Risk/Reward boxes and their transparency are configurable.
- A one-time alert fires on the first invalidation of the day.
- TL;DR workflow
- Build the OR at your chosen time and length.
- Wait for the first valid break (not too small/large).
- Look for a timely retest back into the range (long: bar low inside range; short: bar high inside range), within your entry window and volume filter.
- Enter with your chosen SL/TP scheme; track boxes and (optionally) live R:R labels.
- Respect the daily cap and force-exit time; reset at midnight ET.
僅限邀請腳本
只有經作者批准的使用者才能訪問此腳本。您需要申請並獲得使用權限。該權限通常在付款後授予。如欲了解更多詳情,請依照以下作者的說明操作,或直接聯絡codyxbustamante。
除非您完全信任其作者並了解腳本的工作原理,否則TradingView不建議您付費或使用腳本。您也可以在我們的社群腳本中找到免費的開源替代方案。
作者的說明
Please send an email to BustamanteXLLC@gmail.com to request access
提醒:在請求訪問權限之前,請閱讀僅限邀請腳本指南。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
僅限邀請腳本
只有經作者批准的使用者才能訪問此腳本。您需要申請並獲得使用權限。該權限通常在付款後授予。如欲了解更多詳情,請依照以下作者的說明操作,或直接聯絡codyxbustamante。
除非您完全信任其作者並了解腳本的工作原理,否則TradingView不建議您付費或使用腳本。您也可以在我們的社群腳本中找到免費的開源替代方案。
作者的說明
Please send an email to BustamanteXLLC@gmail.com to request access
提醒:在請求訪問權限之前,請閱讀僅限邀請腳本指南。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。