Quant Analytics: from scratch to pro · Microstructure, execution and costs · Beginner
Order books, spreads and depth
A price on a chart is the last trade, not the price you can trade at. The order book shows the best prices on offer, how much is available at each, and what a round trip costs in basis points or pips.
In this lesson
- Read a simple order book: best bid, best ask, mid price and depth
- Express a spread in price units, basis points and pips
- Compute the average fill price of a market order that walks through the book
- Estimate the round-trip cost of a trade from the spread
Read first: Spreads and trading costs
A chart shows the last price at which a trade happened. It does not show the price at which you can trade now. Between the two sits the order book, and its shape decides what every order costs. This lesson reads one book from the top.
The book
An order book lists the resting limit orders for an instrument. Buyers' orders are bids; sellers' orders are asks (or offers). The highest bid and the lowest ask are the best bid and best ask, the top of the book.
| Side | Price | Size |
|---|---|---|
| Ask | 100.05 | 1,000 |
| Ask | 100.03 | 700 |
| Ask | 100.02 | 400 |
| Bid | 99.98 | 500 |
| Bid | 99.97 | 800 |
| Bid | 99.95 | 1,200 |
The spread is the best ask minus the best bid: here 0.04. The mid price is halfway between them: mid = (bid + ask) / 2, which is 100.00. Mid is a reference, not a price anyone has to deal at. Depth is how much size is resting at each price level; see market depth.
Units: basis points and pips
Spreads are compared across instruments in relative terms. A basis point is one hundredth of a percent, 0.01%. The spread in basis points is spread / mid x 10,000, so 0.04 on 100.00 is 4.0 basis points.
Currency pairs quote a pip, the standard last decimal place: 0.0001 for most pairs, 0.01 for yen pairs. EUR/USD quoted 1.0848 / 1.0850 has a spread of 2.0 pips, or 1.84 basis points of its mid price.
Worked example
You send a market order to buy 900 shares into the book above.
- 400 shares fill at 100.02.
- The remaining 500 fill at 100.03, because the next level has 700 on offer.
The average fill is (400 x 100.02 + 500 x 100.03) / 900, which is 100.0256. That is 2.56 basis points above the mid price, and it is worse than the best ask you saw. A larger order walks further. Depth over the top three levels is 2,500 on the bid side and 2,100 on the ask side, a depth imbalance of (bid - ask) / (bid + ask), which is 0.087. This lesson does not test whether such an imbalance carries information about later prices.
Round-trip cost
Buying at the ask and selling at the bid loses the spread. On 1,000 shares a round trip with a 0.04 spread costs 40.00 before commissions. This cost is paid every time, whether the trade works or not. A method that trades often needs an edge larger than its spreads. See costs in a backtest.
A limit order can earn the spread instead of paying it, but it may never fill, and it tends to fill when the price is moving against it.
Common mistakes
- Treating the last traded price as the price you will get.
- Comparing spreads in price units across instruments. Convert to basis points.
- Forgetting that the spread widens in fast markets and outside main trading hours.
- Assuming the displayed size can be taken in full. Orders can be cancelled before yours arrives.
- Counting only commission as the cost of trading.
In practice
Read the spread and the depth before judging how cheap a market is to trade. Prices that look the same on a chart can carry very different costs. Analytics on FinUties applies measures like these to the markets it covers, so they are at hand when you read a chart. The spreads and trading costs lesson covers the cost side in more detail.
Worked numbers
Each result is recomputed from the formula shown.
| What | Formula | Result |
|---|---|---|
| mid price | (99.98 + 100.02) / 2 | 100.00 |
| spread in price units | 100.02 - 99.98 | 0.04 |
| spread in basis points | spread / mid * 10000 | 4.0 basis points |
| average fill for 900 shares | (400 * 100.02 + 500 * 100.03) / 900 | 100.0256 |
| average fill above mid, in basis points | (avg_fill - mid) / mid * 10000 | 2.56 basis points |
| depth imbalance over three levels | (2500 - 2100) / (2500 + 2100) | 0.087 |
| EUR/USD spread in pips | (1.0850 - 1.0848) / 0.0001 | 2.0 pips |
| EUR/USD spread in basis points | (1.0850 - 1.0848) / ((1.0850 + 1.0848) / 2) * 10000 | 1.84 basis points |
| round-trip spread cost on 1,000 shares | spread * 1000 | 40.00 |
Check yourself
The best bid is 99.98 and the best ask is 100.02. What are the mid price and the spread in basis points?
Mid = (99.98 + 100.02) / 2 = 100.00. Spread = 0.04, and 0.04 / 100.00 = 0.0004 = 4.0 basis points.
EUR/USD is quoted 1.0848 / 1.0850. What is the spread in pips?
One pip is 0.0001 for this pair, so the spread is 0.0002 / 0.0001 = 2.0 pips. That is about 1.84 basis points of the mid price of 1.0849.
Why can a market order to buy 900 shares cost more than the best ask?
Only 400 shares are offered at the best ask. The rest fills at worse prices further up the book, so the average price is above the best ask.
A trader buys with a market order and sells straight back with a market order. Nothing else changes. What does the round trip cost?
About one full spread: the buy fills at the ask and the sell at the bid. Here that is 0.04 on a mid of 100.00, or 4.0 basis points, before any fees.
Key terms
Sources
- Trading and Exchanges: Market Microstructure for Practitioners. Oxford University Press (Larry Harris), 2003. Accessed 9 Nov 2026
- Trades, Quotes and Prices: Financial Markets Under the Microscope. Cambridge University Press (Jean-Philippe Bouchaud, Julius Bonart, Jonathan Donier, Martin Gould), 2018. Accessed 9 Nov 2026