Supply and Demand Zones Darshakssc
- インディケータ
- バージョン: 1.0
📦 Supply & Demand Zones with Smart Filters (MQL5)
This indicator detects high-probability supply and demand zones using a multi-step Smart Money Concept (SMC) approach, specifically optimized for the MetaTrader 5 platform.
🚀 Core Logic
-
Liquidity Sweep Detection: Identifies when price sweeps above a pivot high (supply setup) or below a pivot low (demand setup), capturing liquidity grabs by institutional traders.
-
Displacement Confirmation: Requires a strong displacement candle (measured by ATR and body percentage) or a fair value gap (FVG/imbalance) in the opposite direction immediately after the sweep.
-
Volume Confirmation: An optional filter ensuring zones form only when volume exceeds a user-defined threshold, indicating institutional participation.
-
Smart Filtering: Built-in logic prevents overlapping zones, enforces minimum spacing between signals, and requires confirmation bars to eliminate false signals.
-
Zone Lifecycle Management: Zones are automatically removed when price closes through them with momentum. Breached zones can optionally "flip" to the opposite type when re-tested with strong displacement.
✨ Key Features
-
Clean Visual Display: Clear "D" (Demand) and "S" (Supply) labels placed directly on the chart with shaded zone blocks.
-
Dynamic Zone Shading: Automatically analyzes a rolling 1000-bar window and dynamically darkens the zone color based on its price level (lower supply zones and higher demand zones appear darker), helping you visually identify premium and discount areas at a glance.
-
Non-Repainting: All signals use confirmed historical bar data—no lookahead, no repainting.
-
Volume Filter: Optional confirmation using volume/tick-volume spike detection.
-
Zone Flip Logic: Breached demand zones can become supply (and vice versa) when violated with strong institutional momentum.
-
Overlap & Cluster Prevention: Smart algorithm prevents duplicate or heavily clustered zones in the same price area.
-
Fully Customizable: Adjust pivot sensitivity, displacement thresholds, volume filters, and colors directly from the MT5 inputs tab.
🎯 How to Add to Your MT5 Chart
-
Save the File: Compile the code in MetaEditor and save the .mq5 file inside your MT5 directory: MQL5/Indicators/ .
-
Refresh Navigator: Open MetaTrader 5, go to the Navigator window (Ctrl+N), right-click Indicators, and click Refresh.
-
Attach to Chart: Drag and drop SupplyDemandZones onto your desired asset and timeframe.
-
Customize Settings: In the indicator's Inputs tab, adjust parameters based on your trading style and instrument volatility.
📖 How to Use
🟢 Demand Zones (Green "D" Labels)
-
Condition: Price swept below a swing low (liquidity grab) followed by strong bullish displacement/imbalance.
-
Trading Action: Look for LONG entries when price returns to mitigate the zone or on immediate continuation.
-
Stop Loss: Place just below the zone structure or the sweep low.
-
Target: Next resistance level, opposing supply zone, or fixed risk-reward ratio target.
🔴 Supply Zones (Red "S" Labels)
-
Condition: Price swept above a swing high (liquidity grab) followed by strong bearish displacement/imbalance.
-
Trading Action: Look for SHORT entries when price returns to mitigate the zone or on immediate continuation.
-
Stop Loss: Place just above the zone structure or the sweep high.
-
Target: Next support level, opposing demand zone, or fixed risk-reward ratio target.
🟠 Flipped Zones (Orange Labels)
-
Condition: A previous demand/supply zone was broken with strong institutional momentum, turning its polarity.
-
Trading Action: Exercise caution—wait for additional confirmation or a structural shift before trading flipped zones.
🔍 What to Look For
✅ High-Quality Setups
-
Zone forms with above-average volume (ensure Volume Confirmation is set to true ).
-
Clear, clean liquidity sweep visible on the chart.
-
A strong, explosive displacement candle with a large body percentage.
-
The zone aligns perfectly with the higher timeframe market trend or major key levels.
❌ Setups to Avoid
-
Zones forming in choppy, sideways, or low-volume market environments.
-
Zones that appear immediately during high-impact macroeconomic news events (consider raising confirmation bars during news).
-
Aggressive counter-trend zones without any additional higher timeframe confluence.
⚙️ Recommended Settings by Timeframe
-
5-Minute Charts (Scalping):
-
Pivot Lookback Left/Right: 3 / 3
-
Min Displacement ATR: 0.9
-
Confirmation Bars: 1
-
Min Zone Spacing: 3 to 5 bars
-
Volume Threshold: 1.2x
-
-
15-Minute Charts (Intraday - Default):
-
Pivot Lookback Left/Right: 4 / 4
-
Min Displacement ATR: 1.0
-
Confirmation Bars: 2
-
Min Zone Spacing: 5 to 8 bars
-
Volume Threshold: 1.2x
-
-
1-Hour Charts (Swing Trading):
-
Pivot Lookback Left/Right: 5 / 5
-
Min Displacement ATR: 1.2 - 1.5
-
Confirmation Bars: 3
-
Min Zone Spacing: 8 to 12 bars
-
Volume Threshold: 1.3x
-
