Devs Cumulative Delta candles with Moving Average and Divergence
Jul 12, 2023

The Devs Cumulative Delta candles with Moving Average and Divergence indicator visualizes the relationship between buying and selling pressure through specialized candlestick data, providing traders with a clear view of market order flow and trend exhaustion points.
Usage
The Usage section describes how the script can be used to interpret market dynamics through volume-based price action. The indicator converts standard volume data into Cumulative Delta (CD) candles, where the movement of the candles represents the net difference between buying and selling volume over time.
- Order Flow Interpretation: When the Cumulative Delta is positive, it indicates aggressive buying pressure. Conversely, negative delta signifies aggressive selling pressure.
- Trend Analysis: By applying the three integrated Moving Averages to the CD candles, users can identify the prevailing trend of the volume flow. Reversals often occur when the CD candles interact with or cross the 20, 50, or 200-period averages.
- Divergence Identification: The indicator automatically highlights divergences where price action and volume pressure do not align. A bullish divergence is signaled when price is green but delta shows relative weakness, while a bearish divergence occurs when price is red but delta shows relative strength. These are marked by specific candle color changes (defaulting to blue and orange) to warn of potential trend slowdowns or reversals.
Details
The script constructs Cumulative Delta by calculating the sum of volume associated with upward price movement versus downward price movement. Unlike standard price candles, Delta candles represent the "Delta Max" (High), "Delta Min" (Low), and "Delta Close" based on cumulative volume fluctuations within a session.
The logic follows the principle that price should ideally move in sync with delta. When price makes new highs but cumulative delta fails to follow, or vice versa, the resulting divergence indicates that the current move may lack the necessary volume support to continue. This implementation uses a cumulative calculation (ta.cum) to provide a long-term view of volume sentiment across different price levels and swing points.
Settings
Candle Colors
- Bullish Candle Color: Sets the color for candles where cumulative delta is increasing.
- Bearish Candle Color: Sets the color for candles where cumulative delta is decreasing.
Divergence Colors
- Bullish Divergence Color: Sets the color for candles indicating bullish volume divergence.
- Bearish Divergence Color: Sets the color for candles indicating bearish volume divergence.
Moving Averages
- Moving Average Length 1: The period for the first SMA applied to the cumulative delta (default 20).
- Moving Average Length 2: The period for the second SMA applied to the cumulative delta (default 50).
- Moving Average Length 3: The period for the third SMA applied to the cumulative delta (default 200).
FAQ
How do I interpret the divergence colors on the candles? When the candles change from their standard bullish/bearish colors to the divergence colors, it indicates a mismatch between price action and volume pressure, often suggesting that a trend is losing momentum.
Does this indicator work on all assets? The indicator works on most stocks, indices, and currencies. However, it may not function correctly on assets where historical volume data is unavailable or invisible.
How can I access the Devs Cumulative Delta candles with Moving Average and Divergence indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.