OPEN-SOURCE SCRIPT
Supply & Demand Zone Detector

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.]
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.]
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.