OPEN-SOURCE SCRIPT

Supply & Demand Zone Detector

3 729
Automatically detects and marks Supply & Demand zones using price-action structure, rather than fixed pivot lookbacks.

How it works: the script flags a "breakout" candle when its range exceeds a multiple of ATR and its body makes up most of that range (a strong, low-wick move). It then scans backward for the tight consolidation ("base") immediately preceding that candle — candles whose range stays below a smaller ATR multiple. The high/low envelope of that base becomes the zone: a bullish breakout marks Demand, a bearish breakout marks Supply.

Each zone tracks its own state: it draws solid while fresh, and the first time price trades back into it, the zone is marked tested (dashed, faded) and an alert fires. If price later closes cleanly through the far side, the zone is invalidated and removed — so the chart only shows zones that are still structurally valid.

Inputs: ATR length, breakout/base ATR multipliers, max base candles to scan, optional max zone width (in points), max zones kept on chart.

Limitations: this version detects and manages zones only — it does not generate buy/sell entries. [Zone-touch alerts are provided for you to build your own entry rules around.]

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.