Ready to go further
Next: test a rule honestly
The backtesting guide covers the steps and the traps that catch most short term rules.
What is included
- What it is, in plain words
- The formula or mechanism, with exact arithmetic
- How it hits grid, martingale and DCA bots
- A check you can run before you switch a bot on
Who it is for
- People who run or plan to run a trading bot
- Anyone reading a backtest or a bot sales page
- Readers who want the numbers, not the pitch
- Not advice, and not a signal service
Key facts
- Order flow splits traded volume into buy initiated trades, which hit the ask, and sell initiated trades, which hit the bid. The gap between them is the delta.
- In the made-up bars below, bar 1 traded 1,960 on the buy side and 1,480 on the sell side, so its delta is +480 (calculated by us on 28 Oct 2026, exact).
- Cumulative delta adds the delta bar after bar. After six bars it is +1,410 while the price rose 0.6.
- The data is not free of problems. It needs tick data with the side of each trade, and not every market or feed supplies it.
- A delta is a description of what traded. It does not say what the price does next, and a bot using it still needs a test with costs.
What order flow measures
Every trade has a buyer and a seller. The side that is in a hurry takes the price the other side is offering. A buyer in a hurry pays the ask, and a seller in a hurry accepts the bid. Order flow counts the volume on each side. Where the tape gives the side of each trade, it can be counted directly. Where it does not, tools estimate it from whether a trade printed nearer the ask or the bid, and the estimate is rougher.
Cumulative delta = running total of delta, bar after bar
Volume = buy initiated volume + sell initiated volume
A worked example, one price ladder
Take one bar with five price levels. At each level the volume that traded at the ask and at the bid is shown, and the delta is the difference.
| Price | Bought at ask | Sold at bid | Delta |
|---|---|---|---|
| 100.4 | 90 | 310 | -220 |
| 100.3 | 180 | 420 | -240 |
| 100.2 | 520 | 380 | +140 |
| 100.1 | 760 | 240 | +520 |
| 100.0 | 410 | 130 | +280 |
| Total | 1,960 | 1,480 | +480 |
The bar traded 3,440 in all, with 1,960 on the buy side and 1,480 on the sell side, so the delta of the bar is +480. Look at the shape: sellers dominated the high prices at 100.4 and 100.3, and buyers dominated the low prices at 100.1 and 100.0. That is the kind of picture a trader reads as a fight at each level. It is also only one bar, and these volumes are made up.
Cumulative delta and the divergence
Over six made-up bars the price closed higher on 4 of 5 moves. The cumulative delta did not rise every bar: it went +480, +1,160, +920, +1,780, +1,260, +1,410. On bar 5 the price closed higher with a delta of -520: buyers did not drive that move. Traders call this a divergence and treat it as a warning. It is a talking point, not proof.
Absorption, a common reading
Look back at the ladder. At the lowest level, 100.0, buyers took 410 against 130 sold, and the bar went no lower than that. Traders call this absorption: heavy one sided volume at a level where the price stops, read as the other side quietly taking the flow. The same picture can also just be a level where a lot happened. Two people can read one ladder two ways, which is why a rule built on it must be written exactly and tested, not judged by eye.
What goes wrong for a bot
- Data quality. The side of each trade may be guessed, and a feed that drops ticks changes the delta. A test on clean historical ticks can overstate what a live feed gives.
- Volume is not the whole market. In markets that trade on many venues, one feed shows only part of the volume. Spot currencies have no single central volume, so the figures mean less.
- Speed. Order flow signals are short term, so a rule trades often and pays the spread and slippage many times. See algorithmic trading for how speed multiplies cost.
- Many settings. Bar size, thresholds and look back windows can be tuned until the past looks perfect, which is overfitting.
- Look-ahead. Reading the delta of a bar before it has closed uses information the bot would not have had. See look-ahead bias.
How to check a rule that uses it
Write the rule in words with every threshold, test on tick data with full costs, count the trades and keep data back for one final test, as in backtesting. Then run it in paper trading to see whether live feed delta matches the test. Look at the max drawdown, not only the profit.
What this page does not tell you
It does not say that order flow gives an edge. It shows how the numbers are made. The volumes are made up and this is education, not a signal.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What is order flow?
The study of traded volume split by side: buy initiated trades that hit the ask and sell initiated trades that hit the bid.
How is delta calculated?
Delta is the buy initiated volume minus the sell initiated volume over a bar or a price level. A positive delta means more volume traded at the ask.
What is cumulative delta?
The running total of delta from bar to bar. Traders compare it with the price to look for a divergence.
Can a trading bot use order flow?
It can, if it has tick data with the side of each trade. It trades often, so test it with full costs and check the live feed matches the history.
Does a divergence between price and delta predict a turn?
Not reliably. It describes what traded and is a common talking point. Test any rule built on it.
Are the numbers on this page real?
Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.
Can I use this to decide whether to run a bot?
It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.
Is this financial advice?
No. It is general education about a calculation. The volumes are made up and it is not a signal.
Know the Risk Before You Run It
Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.
Trading carries a risk of loss