OPEN-SOURCE SCRIPT
已更新 SMC Supply & Demand Zones - H4 / H1 / M10

Automatically identifies and draws supply and demand zones across three timeframes (H4, H1, and M10) simultaneously on any chart, using a strict volume-confirmed impulse candle definition rooted in Smart Money Concepts (SMC).
How zones are built
A zone is created only when all three conditions are met on the same candle:
Body size ≥ 1.5 × ATR(14) — filters out indecision candles
Close breaks beyond the prior 5 candles' high (demand) or low (supply) — confirms impulsive intent
Volume ≥ 1.5 × SMA(volume, 20) — requires institutional-level participation
Zone boundaries follow the SMC base candle rule: demand zones span from the impulse candle's open down to its low; supply zones span from its high down to its open.
Visual design
Each timeframe uses a distinct colour family so you can read confluence at a glance — H4 in blue, H1 in orange, M10 in green. Lighter shades mark demand, darker shades mark supply. When price closes fully through a zone, it fades to grey and is tagged with [m] (mitigated) — it stays on the chart for context but is visually de-emphasised. Each zone carries a label (e.g. "H4 D", "H1 S") pinned to its right edge.
Settings
Toggle each timeframe on/off independently
Adjust the body multiplier, prior-bar lookback, and volume multiplier to match the instrument
Set separate caps for active and mitigated zones per timeframe (FIFO — oldest removed first)
Full colour control per timeframe and direction
Toggle labels and borders separately
Non-repainting
All three timeframe feeds use request.security() with lookahead = barmerge.lookahead_off and gaps = barmerge.gaps_off. Zones are created only on the bar where an impulse candle's close is first confirmed — no bar-0 data is used.
Recommended use
Load on your entry timeframe (M10 or M5) and use the H4/H1 zones as bias and confluence levels. Look for price to sweep into a higher-TF zone and react — that is your area of interest for entry confirmation on the lower timeframe.
How zones are built
A zone is created only when all three conditions are met on the same candle:
Body size ≥ 1.5 × ATR(14) — filters out indecision candles
Close breaks beyond the prior 5 candles' high (demand) or low (supply) — confirms impulsive intent
Volume ≥ 1.5 × SMA(volume, 20) — requires institutional-level participation
Zone boundaries follow the SMC base candle rule: demand zones span from the impulse candle's open down to its low; supply zones span from its high down to its open.
Visual design
Each timeframe uses a distinct colour family so you can read confluence at a glance — H4 in blue, H1 in orange, M10 in green. Lighter shades mark demand, darker shades mark supply. When price closes fully through a zone, it fades to grey and is tagged with [m] (mitigated) — it stays on the chart for context but is visually de-emphasised. Each zone carries a label (e.g. "H4 D", "H1 S") pinned to its right edge.
Settings
Toggle each timeframe on/off independently
Adjust the body multiplier, prior-bar lookback, and volume multiplier to match the instrument
Set separate caps for active and mitigated zones per timeframe (FIFO — oldest removed first)
Full colour control per timeframe and direction
Toggle labels and borders separately
Non-repainting
All three timeframe feeds use request.security() with lookahead = barmerge.lookahead_off and gaps = barmerge.gaps_off. Zones are created only on the bar where an impulse candle's close is first confirmed — no bar-0 data is used.
Recommended use
Load on your entry timeframe (M10 or M5) and use the H4/H1 zones as bias and confluence levels. Look for price to sweep into a higher-TF zone and react — that is your area of interest for entry confirmation on the lower timeframe.
發行說明
Added behaviour for mitigated zones發行說明
Changed default valuesAdded Custom value for SMA Volume (default 8 instead of 20)
發行說明
Added H2, M30 zones and alerts for touching the zones發行說明
I've made ATR as an input and changed some defaults發行說明
added M5 / M1 zones發行說明
Added custom Volume SMA length for M5 , M1 .Fixed Replay mode.
發行說明
Added custom SMA/WMA Volume Improved Zone Touched Alert
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。