Order book: spread, depth and imbalance
- Lesson 1 of 2
- Order flow
- steps
- 7
- metrics taught
- 4
- Your test
- Not taken yet
About this lesson
What you'll learn
The order book is the list of buy and sell orders waiting at each price. You'll see how a trade eats through it, why the spread matters, and what depth and imbalance measure.
Buyers below, sellers above
The order book lists the orders waiting to trade. Sellers (asks) sit above the price, each asking a little more. Buyers (bids) sit below, each offering a little less. The bar shows how much BTC waits at each price.
Move your buy price. Below the best ask, your order joins the bids and waits for a seller. At or above the best ask, it trades right away against the sellers.
The spread: the gap in the middle
The spread is the distance between the best ask and the best bid. If you buy and then sell right away, you pay that gap. On BTC it's usually tiny.
When the market gets scared, the traders who keep orders on both sides pull back and the spread opens up. A condition like spread at or above 0.20% catches those moments.
A market order climbs the ladder
A market buy takes the cheapest ask first. If that level doesn't have enough, it takes the next one, and so on up the ladder. The bigger the order, the more levels it eats.
The difference between your average price and the best ask is called slippage. Make the order bigger and watch it grow.
Depth: how much money sits near the price
Depth adds up the orders within a distance of the price. Bots here use 0.5%: bid depth is the dollars waiting to buy down to 0.5% below, and ask depth is the dollars waiting to sell up to 0.5% above.
A deep book takes big orders with little slippage. The chart adds up each side from the price outward. Move the window to see how the totals change.
Imbalance: which side is heavier
Order book imbalance compares the two depths: bids minus asks, divided by both together. +100% would be only buyers, −100% only sellers, and 0 an even book.
A common condition is "bid depth at least 2× ask depth", which is the same as an imbalance of +33%. Orders in the book can be cancelled at any moment, so a heavy side shows intent and can disappear quickly.
Your turn: a lopsided book
These are two hours of imbalance readings, one per minute. Bars above zero mean more bids than asks near the price.
Set the threshold for order book imbalance at or above and replay. Under the chart, the same condition runs on the live feed.
Test what you learned
Three quick questions, then a bot to build.
Read the strategy and set up a bot that follows it, with the direction and the conditions it names and no others. Passing depends on the build alone. Once it's right, the bot fires and you see what the market did next, which won't always go your way.
These lessons explain what each number measures. They are not trading advice, and the lesson charts use simulated data. Preview build: market data on this site is simulated.