OPEN-SOURCE SCRIPT

SMC Reality Check [Concept Hit-Rate Audit]

647
SMC Reality Check [Concept Hit-Rate Audit]

WHAT THIS PUBLICATION ADDS
Hundreds of scripts DRAW Smart Money Concepts. This one MEASURES them.
Every classic SMC event it detects - Order Block retest, Breaker retest,
Fair Value Gap entry, liquidity sweep reclaim, Equal High/Low raid,
structure-break follow-through - is tracked forward, bar by bar, and
resolved as a HIT or a MISS against one uniform, pre-declared rule. The
result is a report card computed on YOUR symbol and YOUR timeframe:
sample size, hit-rate, a Wilson 95% confidence interval, median MFE and
a verdict per concept and side: EDGE, COIN-FLIP or FADE. To my
knowledge, no existing public script forward-tests the SMC toolkit and
reports per-concept outcome statistics like this.

This is deliberately NOT a signal mashup. The six detectors are not
combined to generate entries; each one exists so that its outcomes can
be counted by the same measurement engine. That engine is the reason
the components live in one script: one event definition, one target
rule, one invalidation rule, applied identically to every concept, so
their numbers are comparable side by side. The indicator does not ask
you to believe in SMC. It audits it.

HOW EVENTS ARE DETECTED (all on confirmed bars - nothing repaints)
- Market structure: swing pivots (configurable length) feed a state
machine. A close beyond the last unbroken swing is a structure break
(BOS in trend direction, CHoCH against it) - that bar itself is the
"follow-through" event, expecting continuation.
- Order Blocks: on a structure break, the last opposite-colour candle
before the break becomes the OB (full range or body only). The FIRST
return of price into that zone is the audited retest event.
- Breaker Blocks: an OB broken by the invalidation rule flips polarity
and becomes a Breaker; its first retest is audited the same way.
- Fair Value Gaps: the classic 3-candle imbalance, filtered by a
minimum ATR size. The first return of price into the gap is the event.
- Liquidity sweeps: a wick through a confirmed, unbroken swing high or
low while the bar closes back inside - a stop-hunt. The reclaim close
is the event, expecting a move away from the raided level.
- Equal Highs/Lows: two consecutive swings within an ATR tolerance form
a resting liquidity pool; a wick through it with a close back inside
is the raid event.

HOW OUTCOMES ARE MEASURED
- Every event gets one uniform definition: entry = the event bar close,
target = entry +/- N ATR (default 1.5, measured at event time),
invalidation = the level that falsifies the concept (OB/FVG far edge,
the sweep extreme, the broken structure level; by close or by wick,
selectable).
- HIT: the target is reached before invalidation. MISS: invalidation
first. Conservative by construction: if both happen on the same bar,
it counts as a MISS; if the resolve window (default 40 bars) expires
without a target, it counts as a MISS; if the event bar itself closes
beyond the invalidation, it is an instant MISS.
- Zones are audited on their FIRST test only, so every event is
independent - no double counting. Untested zones that expire are
excluded: statistics describe only what price actually revisited.
- The report card shows, per concept and side: n (resolved events),
hit-rate, the Wilson 95% confidence interval (which is what the
verdict is built from), the median maximum favourable excursion in
ATR, and the verdict: EDGE when the interval's lower bound is above
50%, FADE when the upper bound is below 50%, COIN-FLIP in between,
and no verdict below the minimum sample (default 20).
- Optional Edge Ranking sorts the table by the interval's lower bound,
so the statistically strongest concepts on this chart rise to the top.
A separate filter can restrict markers and alerts to concepts whose
current verdict is EDGE - a display filter only; the statistics always
track every concept.

HOW TO USE
- Read the table before trusting any drawing on the chart - that is the
point of the script. The same concept can be EDGE on one symbol and
FADE on another; the table tells you which is which, here.
- Give it history: statistics need bars. Load more history or use a
lower timeframe if n is small; below the minimum sample the script
deliberately refuses to issue a verdict.
- Treat EDGE as "this event, on this chart, has historically reached
+1.5 ATR before its invalidation more often than not" - context for
your own decisions, not an automatic entry. FADE is a descriptive
label for a historically failing definition, not advice to trade
against it.
- Alerts: create one alert with "Any alert() function call" - each
message names the concept, the side and its measured hit-rate at that
moment. Six classic alertconditions are also available.

SETTINGS GUIDE
- Swing length 5-10 for intraday auditing, 20+ for swing charts.
- Hit target 1.5 ATR and window 40 bars suit intraday; swing traders
may prefer 2-3 ATR with a longer window. Changing the rule changes
the question you are asking - the footer always restates the active
rule so every screenshot carries its own methodology.
- Invalidation "Close" is the forgiving audit, "Wick" the strict one.

LIMITATIONS - READ BEFORE USING
- This is an event study with one fixed rule, not a strategy backtest:
no fees, no slippage, no position sizing, and hit-rate is not P&L. A
hit-rate above 50% against a 1.5 ATR target does not by itself prove
positive expectancy, because the distance to invalidation varies per
event; the 50% line is a neutral reference for the verdict labels,
and the median MFE column adds the magnitude context.
- Pivots confirm after the swing length, so events print with that
structural lag on closed bars only. Reactive by design - the cost of
not repainting.
- Detector definitions are one reasonable, documented interpretation of
SMC concepts; other definitions would produce other numbers.
- The statistics are descriptive for the loaded chart history. Past
behaviour does not guarantee future results. This is a
decision-support tool, not a signal service and not financial advice.

Open-source under MPL 2.0 - study, fork and improve it freely.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.