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.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。