INVITE-ONLY SCRIPT

3-Phase ORB Logic: Break, Retest, Confirm

95
What it is
A state-driven Opening Range framework that sequences Break → Retest → Confirm. It does not just draw ORB lines or tag any breakout; it tracks explicit state transitions with timing and tolerance to filter noise.

How it works (method & originality)
  • Break: After your ORB window, a valid break requires the prior close to be inside the range and the new close to be outside the ORB high/low (prevents slow drift).
  • Retest (configurable): Price must revisit the ORB edge within a tolerance band you define by % of the ORB range or a fixed price. Controls include Retest Side (Inside / Outside / Either), Proximity (Touch / Near), Basis (Close / Wick), and optional Cap Outside (limit far-outside closes). Retest must occur within a Max Bars window; same-bar Break→Retest is optional.
  • Confirm: A later bar must break beyond the max/min of the break + retest reference within Max Bars (or the same bar if enabled). Confirmation can be based on Wick, Close (same-bar only), or Close (always) for stricter behavior.
  • Engine details: Per-bar state resets, explicit bar indexing for Break/Retest/Confirm, dual tolerance modes (percent or price), inside/outside/either logic, selectable wick/close handling, optional same-bar paths, and projected ORB lines. This is a sequence-and-tolerance framework, not a simple ORB level plotter.


Inputs
  • Session: ORB Session window
  • Tolerance: Mode (Percent or Price) + value
  • Retest controls: Retest Side (Inside/Outside/Either), Proximity (Touch/Near), Basis (Close/Wick), Cap Outside (on/off)
  • Timing: Max Bars for Retest, Max Bars for Confirm, Allow same-bar Break→Retest, Allow same-bar Retest→Confirm
  • Confirmation: Confirm Basis (Wick / Close same-bar only / Close always)
  • Display: Plot shapes or hide markers; ORB line projection length (bars)
  • Presets: Classic ORB (Outside • Touch • Close • 20%), Inside Touch (Close • 10%), Either Near (Wick • 15%), or Custom


How to use
  1. Set the ORB session (e.g., 09:30–09:45).
  2. Choose a Preset or use Custom and configure: Tolerance Mode/value, Retest Side/Proximity/Basis, optional Cap Outside.
  3. Set Max Bars for Retest/Confirm and pick Confirm Basis (Wick or Close).
  4. After a Break, wait for a valid Retest within your tolerance window, then a Confirm within the allowed bars.
  5. Act after Confirm (or enable same-bar options if you allow them).
  6. (Optional) Enable alerts for Break / Retest / Confirm; extend ORB lines forward for context.


Marker legend
Triangle = Break, X = Retest, Circle = Confirm (Up = long side, Down = short side.)

When signals reset or expire
  • Retest timeout: If Retest doesn’t occur within Max Bars, the sequence resets to Break-wait.
  • Confirm timeout: If Confirm doesn’t occur within Max Bars after Retest, the sequence resets.
  • Invalidation: With Inside retest, a move too far back inside (beyond tolerance) resets. With Outside retest and Cap Outside ON, a move too far outside (beyond tolerance) resets.
  • Re-entry into the range during the sequence can reset depending on your side/tolerance settings.


Non-repainting behavior
Logic evaluates bar-by-bar with explicit state resets. For stricter confirmation, select Confirm Basis = Close (always).

Practical notes
Works on any timeframe. Match Percent tolerance to instrument volatility or use Price for fixed-tick products. Alerts are provided for each phase. The screenshot shows a full Break → Retest → Confirm sequence with only this script applied.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。