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.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。