OPEN-SOURCE SCRIPT
SMC Volatility Liquidity Pro

this one’s a confluence signaler. it fires “BUY CALL” / “BUY PUT” labels only when four things line up at once: trend, volatility squeeze, a liquidity sweep, and MACD momentum. quick breakdown:
what each block does
Trend filter (context)
ema50 > ema200 ⇒ trendUp
ema50 < ema200 ⇒ trendDn
Plots both EMAs for visual context.
Volatility compression (setup)
20-period Bollinger Bands (stdev 2).
bb_squeeze is true when current band width < its 20-SMA ⇒ price is compressed (potential energy building).
Liquidity sweep (trigger)
Tracks 20-bar swing high/low.
Long sweep: high > swingHigh[1] ⇒ price just poked above the prior 20-bar high (took buy-side liquidity).
Short sweep: low < swingLow[1] ⇒ price just poked below the prior 20-bar low (took sell-side liquidity).
MACD momentum (confirmation)
Standard MACD(12,26,9) histogram.
Bullish: hist > 0 and rising versus previous bar.
Bearish: hist < 0 and falling.
the actual entry signals
LongEntry = trendUp AND bb_squeeze AND liquiditySweepLong AND macdBullish
→ prints a green “BUY CALL” label below the bar.
ShortEntry = trendDn AND bb_squeeze AND liquiditySweepShort AND macdBearish
→ prints a red “BUY PUT” label above the bar.
alerts & dashboard
Alerts: fires when those long/short conditions hit so you can set TradingView alerts on them.
On-chart dashboard (bottom-right):
Trend (Bullish/Bearish/Neutral)
Squeeze (Yes/No)
Liquidity (Long/Short/None)
Momentum (Bullish/Bearish/Neutral)
Current Signal (BUY CALL / BUY PUT / WAIT)
(btw the comment says “2 columns × 5 rows” but the table is actually 5 columns × 2 rows—values under each label across the row.)
what it’s trying to capture (in plain english)
Trade with the higher-timeframe bias (EMA 50 over 200).
Enter as volatility compresses (bands tight) and a sweep grabs stops beyond a 20-bar extreme.
Only pull the trigger when momentum agrees (MACD hist direction & side of zero).
caveats / tips
It’s an indicator, not a strategy—no entries/exits/backtests baked in.
Signals are strict (4 filters), so you’ll get fewer but “cleaner” prints; still not magical.
The liquidity-sweep check uses the prior bar’s 20-bar high/low ([1]), so on bar close it won’t repaint; intrabar alerts may feel jumpy if you alert “on every tick.”
Consider adding:
Exit logic (e.g., ATR stop + take-profit, or opposite signal).
Minimum squeeze duration (e.g., bb_squeeze true for N bars) to avoid one-bar dips in width.
Cool-down after a signal to prevent clustering.
Session/time or volume filter if you only want liquid hours.
if you want, I can convert this into a backtestable strategy() version with ATR-based stops/targets and a few toggles, so you can see stats right away.
what each block does
Trend filter (context)
ema50 > ema200 ⇒ trendUp
ema50 < ema200 ⇒ trendDn
Plots both EMAs for visual context.
Volatility compression (setup)
20-period Bollinger Bands (stdev 2).
bb_squeeze is true when current band width < its 20-SMA ⇒ price is compressed (potential energy building).
Liquidity sweep (trigger)
Tracks 20-bar swing high/low.
Long sweep: high > swingHigh[1] ⇒ price just poked above the prior 20-bar high (took buy-side liquidity).
Short sweep: low < swingLow[1] ⇒ price just poked below the prior 20-bar low (took sell-side liquidity).
MACD momentum (confirmation)
Standard MACD(12,26,9) histogram.
Bullish: hist > 0 and rising versus previous bar.
Bearish: hist < 0 and falling.
the actual entry signals
LongEntry = trendUp AND bb_squeeze AND liquiditySweepLong AND macdBullish
→ prints a green “BUY CALL” label below the bar.
ShortEntry = trendDn AND bb_squeeze AND liquiditySweepShort AND macdBearish
→ prints a red “BUY PUT” label above the bar.
alerts & dashboard
Alerts: fires when those long/short conditions hit so you can set TradingView alerts on them.
On-chart dashboard (bottom-right):
Trend (Bullish/Bearish/Neutral)
Squeeze (Yes/No)
Liquidity (Long/Short/None)
Momentum (Bullish/Bearish/Neutral)
Current Signal (BUY CALL / BUY PUT / WAIT)
(btw the comment says “2 columns × 5 rows” but the table is actually 5 columns × 2 rows—values under each label across the row.)
what it’s trying to capture (in plain english)
Trade with the higher-timeframe bias (EMA 50 over 200).
Enter as volatility compresses (bands tight) and a sweep grabs stops beyond a 20-bar extreme.
Only pull the trigger when momentum agrees (MACD hist direction & side of zero).
caveats / tips
It’s an indicator, not a strategy—no entries/exits/backtests baked in.
Signals are strict (4 filters), so you’ll get fewer but “cleaner” prints; still not magical.
The liquidity-sweep check uses the prior bar’s 20-bar high/low ([1]), so on bar close it won’t repaint; intrabar alerts may feel jumpy if you alert “on every tick.”
Consider adding:
Exit logic (e.g., ATR stop + take-profit, or opposite signal).
Minimum squeeze duration (e.g., bb_squeeze true for N bars) to avoid one-bar dips in width.
Cool-down after a signal to prevent clustering.
Session/time or volume filter if you only want liquid hours.
if you want, I can convert this into a backtestable strategy() version with ATR-based stops/targets and a few toggles, so you can see stats right away.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.