Order book microstructure 101
2026-05-06 · ~7 minute read
Most retail trading bots make decisions from a candle chart and a few moving averages. That is fine for slow swing trades. For anything that touches the order book inside a single minute, it is the wrong abstraction. The order book is the actual market; candles are a one-minute-resolution photograph of it. This post is the short tour of what the photograph misses and why it matters for execution quality.
The book itself, briefly
A limit order book is a sorted list of unfilled buy and sell orders. The best bid and best ask sit at the top of each side. Every visible level has a price, a quantity, and an implicit queue position behind any earlier orders at that level. When a market order arrives, it walks down the book consuming visible quantity until filled or until the price slips beyond a limit.
This is not a model. It is the literal data structure inside the matching engine. Every other concept — spread, depth, imbalance, micro-price — is a derived statistic over the book.
Spread is not the cost of trading
Spread is the gap between best bid and best ask, measured in ticks. The cost of trading is half-spread plus slippage on the quantity you actually want, and slippage depends on visible depth, not on the spread alone. Two markets with the same quoted spread can have very different effective trading costs:
# Illustrative — same 1-tick spread, different effective cost Pair A: bid 100.00 (size 50) / ask 100.01 (size 50) Pair B: bid 100.00 (size 2) / ask 100.01 (size 2) Buying 10 contracts: Pair A: fills at 100.01 entirely -> cost = half-spread Pair B: fills 2 @ 100.01, 8 @ 100.04 -> cost = half-spread + 3 ticks slippage
A bot that decides off candles cannot see this difference. A bot that reads the book can refuse the trade in Pair B, or split it, or wait for refresh.
Book imbalance is a real, but noisy, signal
Imbalance is the ratio of resting size on one side of the book to the other, often weighted by distance from the top. When the bid stack is much heavier than the ask stack near top-of-book, the next print tends to lift the offer more often than not. This is one of the oldest microstructure observations and it survives every venue we have measured.
It is also noisy and easy to abuse. The signal works in aggregate over many trades, and it works only when paired with an honest stop on adverse fills. Indicator-only bots cannot consume this signal at all, because it is not in their input data.
Trade flow is the other half
Trade flow is the stream of executed taker prints — price, size, aggressor side. Cumulative net taker flow over short windows is correlated with short-term price direction, and the correlation is stronger when book imbalance and trade flow agree than when either signal is read alone.
A bot that subscribes to the venue's trade-flow channel and keeps a rolling tally has a richer picture than one polling REST candles every minute. The cost is one extra WebSocket session and a tiny ring buffer in memory. The benefit shows up in slippage statistics over months of trading.
Queue position is the hidden variable
When you place a passive limit order at the top of the book, you are at the back of the queue at that price. You will only fill if every order ahead of you is consumed. If new orders arrive ahead of you (because someone else also wanted that price), your queue position decays without you doing anything.
A serious execution path tracks its own approximate queue position and decides whether to keep waiting, cancel and join a deeper queue, or pay the spread. A bot that just sets a post-only limit and walks away has effectively turned its fill rate over to luck.
Why we read the book
We pay for and consume the venue's level-2 and trade-flow feeds, then derive a small set of features the strategy actually consumes — effective spread, near-top imbalance, recent net taker flow, and an estimate of our own queue position. The strategy does not have to be exotic. Even a simple decision rule informed by these features outperforms a more complex indicator-only bot on the same instrument.
The marketing version of this is “we read the order book.” The honest version is: we treat the book as the ground truth and let candles be a presentation artefact.