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.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.