Range Breakout Outcome Audit

371
Range Breakout Outcome Audit

PURPOSE
This educational indicator studies what happens after a confirmed close breaks a preceding price range. It counts four observed outcomes: target first, invalidation first, ambiguous order, and timeout. The table separates long and short events and keeps every outcome in the denominator.

The focus is a reproducible event sample. A fixed observation window stays reserved even when an outcome is known early, and every event enters the table at the same horizon age. This prevents early outcomes from creating extra sampling opportunities or entering the recent sample sooner than slower outcomes.

EVENT DEFINITION
A long candidate closes strictly above the highest high of the preceding N bars. A short candidate closes strictly below their lowest low. The event bar is excluded from that range, and equality is not a breakout.

Each qualifying close is a candidate; there is no separate crossover or fresh-onset requirement. The indicator selects a candidate only when no earlier observation window is reserved. Candidates inside a reserved window are ignored. The table shows that ignored count across the loaded chart history.

At the selected event's confirmed close, the script freezes its close price and Wilder ATR. ATR includes the event bar. For a long event, the target is the close plus the target ATR multiple, and invalidation is the close minus the invalidation ATR multiple. Short events reverse those directions. Invalidation is an opposite ATR barrier, not a return inside the old range.

OBSERVATION AND CLASSIFICATION
Only the next H confirmed chart bars are observed. Nothing on the event bar is scored, because its high and low may have occurred before the breakout close.

For each later bar, until the first outcome is recorded:
- If its open is at or beyond one barrier, that barrier is the first observed outcome. This covers gaps without assuming an execution price.
- Otherwise, if both barriers are reached or exceeded in that bar, the outcome is ambiguous. The script does not guess the intrabar high/low order.
- If only one barrier is reached, it records target first or invalidation first.
- If neither barrier has been reached through bar H, the outcome is timeout.

Exact barrier equality counts. The first classification is frozen; later price movement cannot change it. Bar H is checked before timeout is assigned.

The full H-bar window remains reserved even after an early classification. Its maturity bar cannot start another event. The earliest possible next event is the following bar. Results join the rolling table only at maturity. The latest unmatured window is excluded even when its first outcome is already known.

READING THE TABLE
K is the maximum number of matured events retained in one shared rolling sample across both directions. The newest matured event replaces the oldest when the sample exceeds K.

Each percentage equals that outcome's count divided by the Events (N) count in its own column. Target first, invalidation first, ambiguous, and timeout therefore account for the whole matured sample. An empty column displays n/a. The Long and Short columns are subsets of the shared last-K sample, not K events each.

The subtitle shows range length, ATR length, target distance (T), invalidation distance (I), horizon (H), and sample limit (K). T and I are ATR multiples. The Unmatured row shows completed observation bars and any outcome already recorded. Loaded-history totals are separate from the rolling sample.

CHART DISPLAY AND USE
Add the indicator to a standard market-price chart and select the range length, ATR length, barrier distances, horizon, and rolling sample size. Default values are illustrative, not optimized settings.

Small E markers identify selected event closes. Teal marks a long event; orange marks a short event. Optional levels show the frozen event close, target, and invalidation during the reserved window; they clear on the maturity bar. They stay fixed after an early outcome while the observation slot remains reserved. Non-standard charts are blocked.

The Data Window exposes matured outcome codes for manual inspection: positive for long and negative for short, with 1 = target first, 2 = invalidation first, 3 = ambiguous, and 4 = timeout. A code appears at the maturity bar. The table always describes the latest dataset state, not the bar under the cursor.

LIMITATIONS
This is an observational, sequentially selected sample, not every breakout. Non-overlapping windows do not imply statistically independent events. Nearby events can share market regimes and overlapping range-estimation data.

Results depend on symbol, timeframe, session settings, available history, and inputs. Changing the horizon changes which candidates are selected. Loading more history can change the initial sampling phase and later selections. Changing target or invalidation distance keeps the event cohort fixed for the same dataset, range, ATR length, and horizon, but changes classifications. Repeated parameter selection after seeing results can overfit the sample.

Large event bars can increase the frozen ATR and widen both barriers. Only included chart bars are observed; movement in excluded sessions is not reconstructed. Feed revisions or changes to the chart dataset can alter historical results. Small samples and rounded percentages need care.

The indicator does not model orders, fills, spread, commissions, slippage, position sizing, account rules, or profit and loss. A target-first percentage is not a trading win rate or a forecast. It provides no validated strategy, profitability claim, or recommendation to trade.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.