OPEN-SOURCE SCRIPT
Quant SMC Pro [JOAT]

QUANT SMC PRO [JOAT]
A complete Smart Money Concepts engine rebuilt from first principles — pivots, structure, order blocks, fair value gaps, liquidity, premium/discount, HTF context, and a 0–100 confluence score per zone — wired together so every element actually talks to every other element. This is the SMC toolkit you build when you have read enough versions of "BOS / CHoCH / OB" to know that the difference between a coin-flip and a real signal is the quality of the underlying pivots, the filter on the order-block detection, and the scoring of how much confluence each zone actually carries.

Pivot engine — adaptive, not arbitrary
A clean structure read is impossible if the pivots themselves are noisy. Quant SMC Pro ships two pivot engines and lets you pick:
A separate, lighter minor-pivot window drives the minor structure layer so you can see internal liquidity grabs without polluting the major read.
Market structure
Both major and minor structure are tracked. BOS (break of structure) and CHoCH (change of character) are labelled in the palette colour at the breaking bar. MSS (market structure shift) is only printed when the requireDisp gate is satisfied: the breaking candle must be a real impulse — strong body, range above an ATR multiple. This single filter eliminates the bulk of the "CHoCH on a doji" false positives that plague off-the-shelf SMC scripts.
Pine Script®
Order Blocks — two detection methods
OBs are detected at the structural origin of the move that broke structure, not blindly at the last opposite candle. Two methods are exposed:
Optional above-average-volume filtering, configurable mitigation rule (wick-touch vs close-through), per-side count cap (1–10), and a structural walk-back window let the OBs stay relevant instead of cluttering up old territory.
Fair Value Gaps — ATR-filtered
FVGs use the standard three-candle imbalance definition, but only register when the gap exceeds a configurable ATR multiple. This is the difference between a clean chart and a wallpaper of 1-tick gaps. Hard caps on count per side, optional extension bars, and an optional "keep mitigated FVGs faded" toggle (off by default to prevent accumulation) round out the controls.
JOAT enhancements (new vs every other SMC script)
Three concepts most public SMC scripts skip — implemented here as proper, gated layers:
Liquidity — equal highs / lows and real sweeps
Equal highs / lows are detected with an ATR-relative tolerance over a configurable scan depth. Liquidity sweeps are detected against actual structural pivots (the minor-pivot output, not a rolling ta.highest) — so a sweep is registered when a wick punctures a recent pivot extreme and the bar closes back inside, which is what the term actually means in the textbook. A cooldown prevents double-prints of the same sweep.
Premium / Discount array
Two equilibrium methods:
A toggleable multi-stop gradient render paints premium and discount as shaded regions instead of just lines. Configurable stop count keeps it tunable.
HTF context
Optional previous-day, previous-week, and previous-month H / L overlays in their own per-timeframe colours. Optional midpoint lines. When enabled, the HTF read also contributes to the confluence score — because no zone is really meaningful without HTF agreement.

Confluence Score (0–100)
Every order block carries an aggregate confluence score derived from:
A "Hide zones below score" input lets you mute lower-quality blocks. A separate alert threshold fires when a zone above your minimum score is created. The score is also rendered into the confluence heatmap dashboard.
Dashboard (confluence heatmap)
A compact, monospaced table positionable to any of nine corners with a per-row vertical alpha gradient. Reads the current bias, nearest premium / discount zone, count of active OBs, count of active FVGs, and the highest confluence score on the chart. Background transparency is user-controlled so it never visually competes with structure.
How to read it
The intended workflow is structure-first, confluence-second. Wait for a BOS or MSS in the direction you want to trade. Look at the OB or breaker block at the origin of the move — its confluence score is your edge proxy. If the zone has an iFVG or active FVG overlap, the score will reflect it. HTF agreement (previous-day midpoint, previous-week high, etc.) is the final filter. Liquidity sweeps before the structural break are a particularly clean confluence — they indicate the move broke because liquidity was taken first.
Originality / what's reused
The SMC vocabulary (BOS, CHoCH, MSS, OB, FVG, premium/discount) is, of course, public-domain market-structure language. The implementations here — the adaptive ATR-confirmed pivot engine, the structural-extreme OB scan, the iFVG gradient render, the breaker block detection, the mitigation block tagging, the AVWAP-anchored PD array, the confluence-score aggregation, and the heatmap dashboard — are written from scratch and tuned together. No third-party code is reused.
Open source
Published open-source under the default Mozilla Public License 2.0. The source is fully readable: every helper function is documented inline, every input has a tooltip, and the file is sectioned with banner headers so you can navigate it like a textbook chapter. If you want to fork it, please keep the credit and please make it materially better — that is what open-source SMC actually needs.
Limitations
SMC is a structural read, not a signal generator — Quant SMC Pro does not print buy/sell labels. It prints zones and structure; you decide the entry. Equal H/L detection and structural sweeps rely on minor-pivot output, so on very illiquid instruments those layers may be sparse. Confluence scoring is heuristic by definition — it ranks zones by features that historically correlated with significance; it does not predict reactions.
—
-made with passion by jackofalltrades
A complete Smart Money Concepts engine rebuilt from first principles — pivots, structure, order blocks, fair value gaps, liquidity, premium/discount, HTF context, and a 0–100 confluence score per zone — wired together so every element actually talks to every other element. This is the SMC toolkit you build when you have read enough versions of "BOS / CHoCH / OB" to know that the difference between a coin-flip and a real signal is the quality of the underlying pivots, the filter on the order-block detection, and the scoring of how much confluence each zone actually carries.
Pivot engine — adaptive, not arbitrary
A clean structure read is impossible if the pivots themselves are noisy. Quant SMC Pro ships two pivot engines and lets you pick:
- Adaptive ZigZag (default) — a pivot is confirmed only after price retraces by an ATR-multiple from the candidate extreme. The threshold is volatility-aware, so the engine produces clean swing structure across very different instruments without retuning.
- Fixed Window — the classic N-bar look-left, N-bar look-right confirmation. Use it on instruments where you want strict symmetry rather than ATR-relative confirmation.
A separate, lighter minor-pivot window drives the minor structure layer so you can see internal liquidity grabs without polluting the major read.
Market structure
Both major and minor structure are tracked. BOS (break of structure) and CHoCH (change of character) are labelled in the palette colour at the breaking bar. MSS (market structure shift) is only printed when the requireDisp gate is satisfied: the breaking candle must be a real impulse — strong body, range above an ATR multiple. This single filter eliminates the bulk of the "CHoCH on a doji" false positives that plague off-the-shelf SMC scripts.
Order Blocks — two detection methods
OBs are detected at the structural origin of the move that broke structure, not blindly at the last opposite candle. Two methods are exposed:
- Structural Extreme (default, stricter) — scans backward inside the walk-back window and selects the most-extreme qualifying opposite-color candle. This is the cleaner output and the one you want on a working chart.
- Last Opposite Candle — the simpler heuristic. Useful for comparison and for replicating the look of older SMC scripts.
Optional above-average-volume filtering, configurable mitigation rule (wick-touch vs close-through), per-side count cap (1–10), and a structural walk-back window let the OBs stay relevant instead of cluttering up old territory.
Fair Value Gaps — ATR-filtered
FVGs use the standard three-candle imbalance definition, but only register when the gap exceeds a configurable ATR multiple. This is the difference between a clean chart and a wallpaper of 1-tick gaps. Hard caps on count per side, optional extension bars, and an optional "keep mitigated FVGs faded" toggle (off by default to prevent accumulation) round out the controls.
JOAT enhancements (new vs every other SMC script)
Three concepts most public SMC scripts skip — implemented here as proper, gated layers:
- Inversion FVGs (iFVG) — when an FVG is mitigated and the polarity flips within a configurable bar window, the gap is re-rendered with a multi-stop gradient so you can see the flipped zone. Off by default because it adds visual density; turn it on when you specifically want to read polarity flips.
- Breaker Blocks — an OB that gets mitigated and then holds on the opposite side for a configurable bar count is re-tagged as a Breaker Block in its own palette color. This is one of the strongest re-entry concepts in SMC and almost never implemented correctly in public scripts.
- Mitigation Block tag — the first OB created after a BOS is tagged "MB" so you can read which block carries the most structural significance.
Liquidity — equal highs / lows and real sweeps
Equal highs / lows are detected with an ATR-relative tolerance over a configurable scan depth. Liquidity sweeps are detected against actual structural pivots (the minor-pivot output, not a rolling ta.highest) — so a sweep is registered when a wick punctures a recent pivot extreme and the bar closes back inside, which is what the term actually means in the textbook. A cooldown prevents double-prints of the same sweep.
Premium / Discount array
Two equilibrium methods:
- AVWAP Equilibrium (default) — equilibrium is anchored to the most recent major structure event, so the PD array drifts with trend rather than re-anchoring on every minor pivot. This is the institutional read.
- Range Midpoint — the classic 50% of the most recent major leg.
A toggleable multi-stop gradient render paints premium and discount as shaded regions instead of just lines. Configurable stop count keeps it tunable.
HTF context
Optional previous-day, previous-week, and previous-month H / L overlays in their own per-timeframe colours. Optional midpoint lines. When enabled, the HTF read also contributes to the confluence score — because no zone is really meaningful without HTF agreement.
Confluence Score (0–100)
Every order block carries an aggregate confluence score derived from:
- Zone size relative to ATR
- Displacement quality of the move that produced it
- Volume on the originating bar relative to the rolling average
- Overlap with active FVGs
- (Optional) HTF level proximity
A "Hide zones below score" input lets you mute lower-quality blocks. A separate alert threshold fires when a zone above your minimum score is created. The score is also rendered into the confluence heatmap dashboard.
Dashboard (confluence heatmap)
A compact, monospaced table positionable to any of nine corners with a per-row vertical alpha gradient. Reads the current bias, nearest premium / discount zone, count of active OBs, count of active FVGs, and the highest confluence score on the chart. Background transparency is user-controlled so it never visually competes with structure.
How to read it
The intended workflow is structure-first, confluence-second. Wait for a BOS or MSS in the direction you want to trade. Look at the OB or breaker block at the origin of the move — its confluence score is your edge proxy. If the zone has an iFVG or active FVG overlap, the score will reflect it. HTF agreement (previous-day midpoint, previous-week high, etc.) is the final filter. Liquidity sweeps before the structural break are a particularly clean confluence — they indicate the move broke because liquidity was taken first.
Originality / what's reused
The SMC vocabulary (BOS, CHoCH, MSS, OB, FVG, premium/discount) is, of course, public-domain market-structure language. The implementations here — the adaptive ATR-confirmed pivot engine, the structural-extreme OB scan, the iFVG gradient render, the breaker block detection, the mitigation block tagging, the AVWAP-anchored PD array, the confluence-score aggregation, and the heatmap dashboard — are written from scratch and tuned together. No third-party code is reused.
Open source
Published open-source under the default Mozilla Public License 2.0. The source is fully readable: every helper function is documented inline, every input has a tooltip, and the file is sectioned with banner headers so you can navigate it like a textbook chapter. If you want to fork it, please keep the credit and please make it materially better — that is what open-source SMC actually needs.
Limitations
SMC is a structural read, not a signal generator — Quant SMC Pro does not print buy/sell labels. It prints zones and structure; you decide the entry. Equal H/L detection and structural sweeps rely on minor-pivot output, so on very illiquid instruments those layers may be sparse. Confluence scoring is heuristic by definition — it ranks zones by features that historically correlated with significance; it does not predict reactions.
—
-made with passion by jackofalltrades
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.