Volume tells you how much traded. It does not tell you who was in control. A bar with heavy volume that closes on its high is a very different event from the same volume closing on its low, and a plain volume histogram treats them the same.
Cumulative Delta, by TFlab (TradingFinder), splits the volume of every bar into a buying part and a selling part based on where the bar closes, takes the difference, and accumulates it. The result is drawn in its own panel as a chart of candles: each candle opens where the previous value was and closes at the current one, green when the delta pushed the line up and red when it pushed it down. You read it like a price chart of pressure.
Three accumulation modes let you choose the horizon: the running total since the start of the history, a rolling sum over a fixed number of bars, or an exponential average.
Without tick data you cannot know how much of the volume hit the ask and how much hit the bid. This indicator uses a simple and widely used estimate: the close location inside the bar.
buying = volume * (close - low) / (high - low)
selling = volume * (high - close) / (high - low)
delta = buying - selling
A close on the high assigns the whole volume to buyers. A close on the low assigns it all to sellers. A close in the middle splits it evenly and the delta is zero. It is an approximation of order flow, not a measurement of it, and it should be read that way: it captures who won the bar, weighted by how much traded.
A bar with no range at all (high equal to low) has no close location to read, so its delta is zero.
Each value is drawn as a candle body from the previous value to the current one. A green body means the accumulated delta rose on that bar, a red body means it fell. The candles make the rhythm of the pressure easy to see: long green runs, hesitation, and the first red bodies when buyers stop winning.
cumMode (default: 0): accumulation mode. 0 = Total (running sum), 1 = Periodic (rolling sum), 2 = EMA.period (default: 21): number of bars used by the Periodic and EMA modes. It has no effect in Total mode.The indicator needs volume. On instruments where the feed has no volume, or only tick volume, the delta will be zero or only indicative. For currency pairs, applying it on the corresponding futures contract gives a more representative reading.
//-------------------------------------//
//PRC_Cumulative Delta
//version = 0
//22.09.26
//Iván González @ www.prorealcode.com
//Author: TradingFinder
//Sharing ProRealTime knowledge
//-------------------------------------//
//-------------------------------------//
// Inputs
//-------------------------------------//
cumMode = 0 // 0 = Total (running sum), 1 = Periodic (rolling sum), 2 = EMA
period = 21 // Length used by the Periodic and EMA modes
//-------------------------------------//
// Buying and selling volume
// The close location inside the bar splits the volume: a close on
// the high is all buying, a close on the low is all selling.
//-------------------------------------//
barRng = high - low
IF barRng > 0 THEN
buyVol = volume * ((close - low) / barRng)
sellVol = volume * ((high - close) / barRng)
ELSE
// Flat bar (high = low): no location to split, no delta
buyVol = 0
sellVol = 0
ENDIF
delta = buyVol - sellVol
//-------------------------------------//
// Cumulative delta in the selected mode
//-------------------------------------//
once cumTotal = 0
cumTotal = cumTotal + delta
IF cumMode = 1 THEN
cumD = summation[period](delta)
ELSIF cumMode = 2 THEN
cumD = average[period,1](delta)
ELSE
cumD = cumTotal
ENDIF
//-------------------------------------//
// Candles: open at the previous value, close at the current one
//-------------------------------------//
IF barindex > period THEN
cOpen = cumD[1]
IF cumD >= cOpen THEN
cr = 76
cg = 175
cb = 80
ELSE
cr = 255
cg = 82
cb = 82
ENDIF
DRAWCANDLE(cOpen, max(cOpen, cumD), min(cOpen, cumD), cumD) COLOURED(cr, cg, cb)
ENDIF
// The line is transparent: it only sets the panel scale and exposes
// the value for alerts and the cursor readout.
RETURN cumD AS "Cumulative Delta" COLOURED(128, 128, 128, 0)
Cumulative Delta turns an ordinary volume column into a story about control: who won each bar, how decisively, and whether that balance is building or fading. Drawn as candles and available over three horizons, it gives a quick read of the pressure behind a move and a clean way to spot moves that price makes on its own.