baseedge_labs
← indicators

Aggressor Volume Delta

draft

v2.0.0 · updated Sep 7, 2026

Estimates which side crossed the spread on each bar by classifying sub-bar volume with the tick rule, then plots the running total as candles whose body is that bar's delta.

volume deltaorder flow proxytick rule
method
Tick rule on 1-second sub-bars
approximates
Aggressor side. Pine has no bid/ask-tagged trade data at any subscription tier, so side is inferred from sub-bar price direction, not observed from executions. This is not order flow.
requires
Second-resolution intrabar data (a real-time futures data plan) for the 1S default; falls back to 1-minute sub-bars, at lower fidelity, without it.
exports
Bar deltaCumulative deltaDelta %Buy volumeSell volumeCoverage %Data OK

What it measures

Every bar is broken into its finest available sub-bars. Each sub-bar’s volume is booked to buy if that sub-bar closed above the previous one and to sell if below; an unchanged tick inherits the last non-flat direction. That is the tick rule (Lee-Ready-style), and the difference between the two totals is the bar’s delta.

The running total is drawn as candles: open is the total at bar start, close is the total after this bar, so the body is this bar’s delta and the wicks are the intrabar high and low of the running total. One series, one scale.

What it is not

It is not order flow. Pine Script has no bid/ask-tagged trade data at any subscription tier — OHLCV is the entire data model — so no Pine script can see which side a trade actually executed against. This one infers side from price direction. Finer sub-bars get closer; nothing in Pine gets there.

Two consequences worth stating plainly:

Reading it

Above or below zero is not bull or bear. The cumulative total resets each session, so its level is net aggressor volume since that reset and its zero-crossing is an artifact of where the reset landed. What carries information is the slope — is it still accumulating? — and divergence against price: price makes a higher high while delta makes a lower high, and the buying that would justify the new high is not there. Those divergences are marked automatically.

The divergence marks are unmeasured. They are the standard reading of cumulative delta and they are why the script is worth publishing, but no hit rate has been established for them on any instrument, and none is claimed here. A pivot is also not confirmed until the bars to its right exist, so every mark appears a few bars after the fact — that lag is structural, not a setting.

Using it in a strategy

Seven series are exported and selectable from another script via input.source(). One constraint governs all of them: intrabar requests recalculate on every realtime tick, so the live bar’s delta moves until that bar closes. Anything gating entries on it must read the confirmed value — reference the export at [1], or gate on barstate.isconfirmed. Reading the live value will backtest beautifully and behave differently in real time.

Status

Draft. It compiles clean against the TradingView v6 compiler and its logic is reviewed, but it has not yet been run on a live chart or checked against TradingView’s own built-in volume delta. No performance figure is attached to it because it takes no positions and has none.