Cumulative delta is one of those tools that looks like a direct reading of aggression. Up-volume minus down-volume, summed, and the slope tells you who was lifting offers and who was hitting bids. That reading exists when you have every trade. Pine Script on a chart does not. A bar gives you open, high, low, close, and volume. Anything called delta on that bar is an estimate, and an estimate that is not labeled as one will be trusted as if it were the tape. Delta Flow is the library indicator that uses the estimate, names it, and then looks for three events on top of it: a price swing that delta does not confirm, a burst of volume that fails to move price, and a wide bar where one side of the estimate took almost all the volume.
Short answer
Delta Flow splits each bar's volume by where the close sits in the range. A close at the high counts the whole bar as estimated buying. A close at the low counts it as estimated selling. A close in the middle splits it. Cumulative delta is that difference, drawn as candles that reset each UTC day up to the 1-hour chart, each week on higher intraday charts, and never on a daily chart. Divergence compares price swings with the never-reset total, so a reset cannot hide a disagreement. Absorption is heavy volume in a small range with delta pushing one way and the close refusing. Imbalance is a wide, heavy bar with one side at 80 percent or more. All of it is estimated from the bar. None of it is exchange order flow.
Key facts
- Estimated buying volume is volume times (close - low) / (high - low). Selling volume is the rest. A zero-range bar is split in half.
- Delta is estimated buying minus estimated selling. It is not the difference of trades printed on the bid and the ask.
- Auto reset uses the UTC day when the timeframe is intraday and the multiplier is 60 or less, the week on higher intraday charts, and no reset on daily charts and above.
- You can force Session, Week, or None. The candles and the orange average restart at the reset. Divergence does not use the restarted series.
- Candle color brightens when the bar's delta is at least two standard deviations from its 50-bar mean.
- The orange line is an exponential average of cumulative delta with length 21, restarted at each reset so the old period does not drag across.
- A bullish divergence is a lower swing low in price and a higher swing in the never-reset cumulative delta. Bearish is a higher price high and a lower delta swing. The swing length is 5, so the mark appears 5 bars after the swing.
- The two swings have to be within 60 bars of each other. The line between them is drawn only when both swings sit inside the same reset.
- Absorption needs volume at least 1.5 times average and an effort ratio of at least 2.5. Bullish absorption is negative delta with a close that did not fall. Bearish absorption is positive delta with a close that did not rise.
- Imbalance needs volume at least 1.5 times average, a range at least as wide as the 14-bar ATR, and one side at 80 percent or more of the bar's volume.
| Event | Price | Estimated delta | Default threshold |
|---|---|---|---|
| Bullish divergence | Lower swing low | Higher swing in cumulative delta | 5-bar pivot, within 60 bars |
| Bearish divergence | Higher swing high | Lower swing in cumulative delta | Same |
| Bullish absorption | Close did not fall | Negative, and the bar is small for its volume | 1.5x volume, effort 2.5 |
| Bearish absorption | Close did not rise | Positive, and the bar is small for its volume | Same |
| Buy imbalance | Range at least the ATR | Buying share at least 80 percent | 1.5x volume |
| Sell imbalance | Range at least the ATR | Buying share at most 20 percent | 1.5x volume |
The split is a close location, and it is only a split
Take a bar with a low of 100, a high of 110, a close of 108, and volume of 1,000. The close sits 8 dollars above the low in a 10 dollar range, so the estimate calls 800 of the volume buying and 200 selling. Delta is +600. Move the close to 100 and the same volume is entirely selling. Move it to 105 and delta is zero. A bar with no range at all is split 500 and 500, because there is no position inside the range to read. That is the whole model. It is the standard substitute when the feed does not tell you which trades printed on the bid and which on the ask.
The failure mode is easy to picture. A bar can close on its high because a single small trade printed there after a lot of selling, or because buyers really did lift the offer all the way up. The estimate treats those cases as identical. On a liquid crypto market with a steady tape, the close location is often a fair sketch of the bar. On a thin bar, or a bar with a long wick and a close back in the middle, it is a sketch of the close and nothing else. Delta Flow does not upgrade the sketch. It uses it consistently, which is the useful property: the same bar always produces the same delta, and you can recompute it by hand.
Switching the pane to Bar delta draws that per-bar difference as columns. Cumulative delta sums it. The columns are the better view when you want the estimate of one bar. The candles are the better view when you want to see whether the estimates have been pointing the same way for a while. Neither view gets closer to the tape. They are two presentations of one formula.
//@version=6
indicator("Estimated delta from the close", overlay = false)
rng = high - low
buyVolume = rng > 0 ? volume * (close - low) / rng : volume * 0.5
sellVolume = volume - buyVolume
delta = buyVolume - sellVolume
plot(delta, "Bar delta", delta >= 0 ? color.teal : color.red, style = plot.style_columns)
hline(0)This is the split the library script uses, and nothing more. Cumulative candles, divergence lines, absorption, and imbalance are all downstream of delta. If you disagree with the split, change this formula first. Everything else will follow it.
Resets keep the candles readable. Divergence ignores them.
A cumulative sum that never resets eventually becomes a large number whose recent wiggles are hard to see. A sum that resets every session throws away the comparison you wanted across the boundary. The script does both, on purpose, with two different series. The candles use a sum that subtracts its value from just before the last reset, so each period starts at zero. The orange average is an exponential average of that restarted sum, with the same restart, length 21, so the new period is not still anchored to the previous one.
Auto mode picks the reset from the timeframe. Up to and including the 1-hour chart, the multiplier is 60 or less and the chart is intraday, so the reset is the UTC day. A 4-hour chart is still intraday, but a day holds only six of those bars, which is not enough to compare two swings inside one period, so Auto uses the week. A daily chart and anything higher never resets. You can override Auto with Session, Week, or None. The override does not change the divergence test.
Divergence compares swings of price with swings of the never-reset running total. A reset sitting between the two swings cannot manufacture a divergence, and it cannot hide one. The line you see on the candles is a different courtesy: it is drawn only when both swings fall inside the same reset segment, because a line across a restart would connect two numbers that do not share a zero. You can have a D label whose connecting line is absent. That means the disagreement is real on the raw total and the two swings are in different periods of the candle view. It is not a bug in the label.
Divergence waits for the swing, then compares the raw total
A price swing high is a pivot of high with five bars on each side. It becomes available five bars after the high. On that confirmation bar the script looks at the raw cumulative delta as it stood on the pivot bar, and it compares the new pivot with the previous one. Bearish divergence is a higher price high and a lower raw delta. Bullish divergence is a lower price low and a higher raw delta. The previous pivot has to be within 60 bars. Farther apart than that, the script updates its memory and draws nothing.
The lag is the same lag as any honest pivot. A divergence label on the exact high, with no delay, on historical bars, was allowed to know that the high would hold. This one appears when the right-hand bars exist, and the line runs between the two pivot bars rather than between the confirmation bars. The guide to ta.pivothigh is the longer explanation. The same rule is why a divergence indicator and a liquidity-pool indicator both feel late. They are late because the swing is late.
Five and sixty are inputs. A shorter pivot confirms sooner and finds smaller swings, so you will see more disagreements, including ones that are just noise in the estimate. A longer pivot does the opposite. The gap limit stops a January swing from being compared with an April swing and called a divergence. Raise it if your question is actually about swings that far apart. Lower it if the lines are connecting moves that no longer belong in one sentence.
Absorption is effort without result. Imbalance is a wide bar, mostly one side.
Absorption uses Wyckoff's effort-versus-result idea as a number, not as a story. Effort is relative volume divided by the bar's range in units of ATR, and the range is not allowed to contribute less than a tenth of an ATR, so a one-tick bar cannot explode the ratio by itself. The defaults require relative volume of at least 1.5 and an effort ratio of at least 2.5. On top of that, the estimate and the close have to disagree. Bullish absorption is a heavy, narrow bar whose delta is negative while the close is at or above the previous close. The estimate says selling, the close did not fall. Bearish absorption is positive delta and a close that did not rise. Circles mark those bars in the oscillator pane, cyan at the bottom for the bullish case and orange at the top for the bearish case.
Imbalance is the opposite shape. The bar has to be at least as wide as the 14-bar ATR, on at least 1.5 times average volume, and one side of the estimate has to be at least 80 percent of the volume. A close near the high of a wide, heavy bar is a buy imbalance. A close near the low is a sell imbalance. Triangles mark them. They are not graded. A bar can be an imbalance and also be part of a divergence swing later. The two tests do not cancel each other.
Both tests run on a confirmed bar. A wide bar that is still forming does not get a triangle, and a bar that looks narrow intrabar does not get a circle until the close has fixed the range. That matters because effort uses the range. A bar that spends most of its life as a narrow, heavy print and then expands into a wide close will fail the absorption test and may pass the imbalance test instead. The close is the only version of the bar the marks use.
Use it as an estimate, and change the estimate in the editor
Delta Flow is included in every paid plan. It is a separate pane, with a budget of 100 lines for the divergence segments. If old divergence lines disappear, that budget is why, and deleting a line object when you no longer need the segment is the usual fix. The script already draws a line only for the pair it just confirmed. It does not keep an unbounded history beyond what the runtime retains.
The chart inside PineScripter is crypto spot, 308 markets from Binance public data, up to 5,000 bars. Estimated delta on that data has the same limitation as estimated delta anywhere else: the exchange trade tape is not in the bar. Paste the script into TradingView for other markets, and do not expect the numbers to match a footprint chart that really does have bid and ask volume. If they disagree, the footprint is the one with the trades. This indicator is the one that can run on bars alone.
The edit that changes the indicator the most is the split, not the colors. Some people use the body instead of the full range, or they assign the upper wick to buying and the lower wick to selling. Those are different estimates, and they will move every divergence, every circle, and every triangle. Open the script from the indicator library and change the two lines that compute buy and sell volume. Then look at the same day you already know. You are comparing definitions. You are not debugging a feed.
Frequently asked questions
Is Delta Flow real order-flow delta?
No. Exchange delta needs every trade classified by the bid or the ask. This indicator estimates buying and selling from where the close sits between the bar high and the bar low. The same bar always produces the same estimate. A different formula would produce a different one. Neither is the tape.
When does cumulative delta reset?
On Auto, it resets each UTC day up to the 1-hour chart, each week on higher intraday charts, and it does not reset on daily charts and above. You can force a session, a week, or no reset. Divergence is computed on the sum that never resets, so the candle reset does not create or hide a divergence.
Why is there a D label with no line?
The label means the price swing and the raw cumulative delta disagreed. The line is drawn on the candles only when both swings are inside the same reset. Swings in different periods still get the label, without a line across the restart.
What is absorption in this script?
A closed bar with volume at least 1.5 times its 50-bar average, a range that is small relative to that volume, and a disagreement between estimated delta and the close. Negative delta with a close that did not fall is the bullish case. Positive delta with a close that did not rise is the bearish case.
Does a divergence label tell me the price will reverse?
No. It says that between two confirmed swings, price made a more extreme high or low and the estimated cumulative delta did not. What happens after that is not something the script measures.
The practical takeaway
Say the estimate out loud before you read the candles. Buying volume is the share of the bar above the low, selling volume is the rest, and delta is the difference. The candles restart so you can see the current period. Divergence uses the sum that does not restart, and it waits until the price swing is confirmed. Absorption is a lot of volume in a small range with the close refusing to follow the estimate. Imbalance is a wide, heavy bar that closed near one end. All four are rules you can recompute from the bar. None of them is the order tape, and none of them is a forecast.
Delta Flow is in the indicator library on every paid plan. The close-location split is a few lines, and everything else hangs off it. PineScripter opens the script so you can change that split, or the effort ratio, and see which marks move.
Sources
- Pine Script v6 reference: ta.pivothigh
- Pine Script v6 reference: ta.atr
- Pine Script v6 reference: ta.stdev
Related reading: Volume Pulse, which weights the same bars differently, a profile built from the same estimated split, divergence detection that waits for the pivot, why a 5-bar pivot is 5 bars late.
Disclaimer: PineScripter is a coding tool for Pine Script development. It does not provide financial advice and does not guarantee trading profits. Always backtest strategies thoroughly and understand the risks before live trading.