Cumulative Delta Proxy
Cumulative delta measures the net volume accumulation of a security by treating each candle's volume as positive when price closes above the prior bar, and negative when below. The running sum creates a trace showing whether net volume is flowing in (accumulation) or out (distribution) of the asset. In traditional delta analysis, this separation is grounded in bid/ask tick data; this indicator approximates it using close-to-close direction as a proxy, making it practical on any timeframe without Level 2 feed requirements.
Traders use cumulative delta to confirm trend strength, spot divergences (price makes a new extreme but delta does not), and validate breakouts. The tool is especially useful on intraday timeframes but applies equally to daily and swing charts. Rising delta into resistance that is then broken suggests conviction; rising price on falling delta warns of weakening accumulation and possible reversal.
//@version=6
indicator("Cumulative Delta Proxy", "Delta", overlay=false)
// Inputs
volSource = input.source(volume, "Volume Source")
showHist = input.bool(true, "Show as Histogram")
posColor = input.color(color.new(color.green, 0), "Up Volume Color")
negColor = input.color(color.new(color.red, 0), "Down Volume Color")
lineWidth = input.int(2, "Line Width", minval=1, maxval=4)
// Cumulative delta: add volume on up bars, subtract on down bars
dVol = close > close[1] ? volSource : close < close[1] ? -volSource : 0
cumDelta = ta.cum(dVol)
// Color based on direction
barColor = cumDelta >= 0 ? posColor : negColor
// Plot with conditional style
if showHist
plot(cumDelta, "Cumulative Delta", barColor, linewidth=lineWidth, style=plot.style_histogram)
else
plot(cumDelta, "Cumulative Delta", barColor, linewidth=lineWidth)
// Zero reference line
hline(0, "Zero Line", color.new(color.gray, 50))
How the code works
The indicator reads volume on each bar via input.source(), defaulting to the built-in volume variable. It then applies a three-way comparison: if the close is strictly higher than the previous close, the bar's volume is counted as positive (up volume); if lower, negative (down volume); if equal or unchanged, zero. This ternary assignment feeds into ta.cum(), Pine's cumulative-sum function, which adds each signed volume to the prior total.
The result is a running trace starting at zero. Each bar either adds or subtracts volume, producing a trace that climbs on up-volume bars and descends on down-volume bars. The color flips based on whether cumulative delta is above or below zero: green for positive (net accumulation), red for negative (net distribution). The zero line provides a visual baseline. The plot can render as either a histogram (column chart) or a line, selectable via user input.
Reading it on a chart
Cumulative delta functions as a confirmation indicator rather than a standalone signal. In an uptrend, if price makes a higher high and delta simultaneously reaches a new peak, momentum is intact and the trend is being driven by sustained buying pressure. If price reaches a higher high but cumulative delta fails to match, a classic bearish divergence, accumulation is thinning and a reversal may follow. The inverse applies to downtrends: lower lows paired with lower delta lows confirm capitulation; lower price but higher delta lows signal demand returning.
On intraday charts, traders watch for delta "exhaustion" events: extreme spikes (very high positive or negative) that often coincide with sharp reversals. A gentle, steady rise in delta into a level breakout is more trustworthy than a breakout with falling or flat delta. Support and resistance levels also appear on the delta trace itself: bounces off a prior low in the delta line can precede price bounces, providing a leading edge for entry timing.
Limitations
This indicator carries important constraints that must be acknowledged.
First, it is a proxy, not true delta. Real delta relies on Level 2 or Level 3 bid/ask volume data showing every trade executed at each price level. Close-to-close direction is a heuristic that cannot detect intrabar absorption, a bar opening at 100, rallying to 105, then closing at 99 registers as down volume here, even though the bulk of volume may have traded at higher prices. Iceberg orders, internalized flows, and algo slicing are invisible.
Second, volume accuracy varies by asset class. Equities report consolidated tape data post-execution. Forex and cryptocurrency aggregate volume from disparate venues with time lags. Futures and options have exchange-reported volume, but open interest (not reflected here) is often more relevant to structural positioning. No market reports true delta uniformly.
Third, cumulative delta is path-dependent and boundless. Its absolute level conveys nothing; only its trend and shape relative to price matter. A single-bar volume spike can distort the entire trace. This makes outliers problematic: a $2 billion block trade will create a massive delta spike regardless of the underlying order flow pattern, obscuring medium-term signals in liquid markets.
Fourth, divergences are visually subjective. Identifying a valid bearish divergence requires judgment about which peaks to compare, and noisy or choppy markets produce frequent false signals. A divergence at a structural support level is more reliable than one in the middle of a ranging consolidation.
Finally, on longer timeframes (weekly, monthly), the indicator aggregates such large volumes that intraday and daily structure flattens into a single cumulative trace with limited actionability.
Key definitions
Delta: Net volume difference between up and down price moves; positive when more volume trades on up ticks, negative on down ticks.
Up volume: Volume transacted on candles that close above the prior close, interpreted as buying interest.
Down volume: Volume transacted on candles that close below the prior close, interpreted as selling interest.
Cumulative: A running total that adds or subtracts each new value to the prior sum, creating a trace that reflects historical net flow.
Divergence: When price and an indicator move in opposite directions (e.g., price higher, delta lower), signaling weakening momentum or impending reversal.
Bid/ask data: Market microstructure information showing volume offered at each price on both sides; unavailable from standard candle data and required for true delta.
References
- CME Group, "Understanding Volume and Open Interest in Futures", CME Education. Https://www.cmegroup.com/education/courses/basics-of-futures/understanding-volume-and-open-interest.html
- SEC, "Market Data", U.S. Securities and Exchange Commission. Https://www.sec.gov/divisions/marketreg/market-data.html
- Investopedia, "Volume Weighted Average Price", Investopedia. Https://www.investopedia.com/terms/v/vwap.asp
- FINRA, "Market Regulation", Financial Industry Regulatory Authority. Https://www.finra.org/
- Wikipedia, "On-Balance Volume", Wikipedia. Https://en.wikipedia.org/wiki/On-balance_volume
Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard.
Last reviewed by the PropLedger research pipeline: 2026-09-06. Educational research on historical data, not financial advice.
Keep reading
Rolling Correlation Between Two Symbols
Free open-source Pine Script indicator: rolling correlation between two symbols. Full code and a plain-English walkthrough.
Equity Session Ranges: Overnight vs Regular Hours
Free open-source Pine Script indicator: equity session ranges: overnight vs regular hours. Full code and a plain-English walkthrough.
Volume Climax Detector
Free open-source Pine Script indicator: volume climax detector (volume z-score). Full code and a plain-English walkthrough.