OPEN-SOURCE SCRIPT
Primitive Delta Divergence

Primitive Delta Divergence
This indicator detects volume-price divergences by analyzing the relationship between price direction and volume bias over a rolling lookback period, revealing potential momentum shifts before they become apparent in price action alone.
Instead of relying solely on price movements, you can identify moments when volume sentiment contradicts price direction — a core concept borrowed from footprint chart analysis, adapted for traditional bar charts.
For example, when price moves higher but volume is predominantly bearish, or when price declines while volume shows bullish accumulation.
🔹 How it works
Lookback Period (n) → defines the rolling window for analyzing price and volume relationships
Creates a "meta-candle" from the lookback period, comparing its open vs. close for price bias
Volume classification → separates each bar's volume into bullish (green candles), bearish (red candles), or neutral (doji candles)
Volume bias calculation → generates a continuous score (-1 to +1) representing the directional volume pressure
Plots divergence signals when price direction and volume bias disagree
🔹 Use cases
Spot early momentum exhaustion when price and volume move in opposite directions
Identify potential reversal zones where volume suggests underlying weakness or strength
Enhance entry/exit timing by incorporating volume-based confirmation alongside price action
Apply footprint-style analysis to any timeframe without specialized charting tools
✨ Primitive Delta Divergence reveals the hidden story volume tells about price, uncovering divergences that traditional indicators might miss.
This indicator detects volume-price divergences by analyzing the relationship between price direction and volume bias over a rolling lookback period, revealing potential momentum shifts before they become apparent in price action alone.
Instead of relying solely on price movements, you can identify moments when volume sentiment contradicts price direction — a core concept borrowed from footprint chart analysis, adapted for traditional bar charts.
For example, when price moves higher but volume is predominantly bearish, or when price declines while volume shows bullish accumulation.
🔹 How it works
Lookback Period (n) → defines the rolling window for analyzing price and volume relationships
Creates a "meta-candle" from the lookback period, comparing its open vs. close for price bias
Volume classification → separates each bar's volume into bullish (green candles), bearish (red candles), or neutral (doji candles)
Volume bias calculation → generates a continuous score (-1 to +1) representing the directional volume pressure
Plots divergence signals when price direction and volume bias disagree
🔹 Use cases
Spot early momentum exhaustion when price and volume move in opposite directions
Identify potential reversal zones where volume suggests underlying weakness or strength
Enhance entry/exit timing by incorporating volume-based confirmation alongside price action
Apply footprint-style analysis to any timeframe without specialized charting tools
✨ Primitive Delta Divergence reveals the hidden story volume tells about price, uncovering divergences that traditional indicators might miss.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.