Better than the mid: order-book imbalance and the microprice
The mid price, halfway between the best bid and the best ask, is the default estimate of what a stock is worth right now. But it ignores how much is resting at each price. If the ask has two lots left and the bid has eight, a couple of buy orders will clear the ask and the price will tick up. Traders who watch the queue sizes have a better estimate of fair value: the microprice.
The thin side gets eaten first
A price moves when a queue at the best bid or ask is emptied, by trades or cancellations. If the ask queue is much smaller, it’s likely to empty first, and then the best ask moves up and the mid with it. So imbalance predicts the direction of the next price change. The weighted mid in step 2 turns that into a price: with and a one-cent spread, it sits 0.3 cents above the mid.
You can rewrite the weighted mid as : it’s the expected next mid if the next move is half a spread, and up with probability exactly I. Whether that’s right depends on how queues actually evolve.
A race between two queues
The simplest model of queue dynamics: each event hits one of the two queues at random, adding or removing one lot with equal probability (an order arriving or a trade/cancel). The price ticks up if the ask queue empties first, down if the bid does. The probability of an uptick from queue sizes satisfies a discrete Laplace equation: it’s the average of its four neighbours, with boundary values 1 when and 0 when . The figure solves it numerically on a grid.
Top of the book (bid 99.99, ask 100.01)
P(next move is up) vs imbalance, every queue pair
Every dot is one pair of queue sizes up to 20. They hug the line , so the weighted mid is a good first approximation, but they bend away from it at the extremes: with 9 lots on the bid and 1 on the ask, the model gives about 92% for an uptick rather than 90%. Pairs with the same imbalance but different total depth give slightly different probabilities, which is why practitioners condition on more than the ratio. A Monte Carlo check of the same model agrees to within a percentage point: about 84% for (8, 2) and 92% for (9, 1).
import numpy as np
def weighted_mid(bid, ask, q_bid, q_ask):
I = q_bid / (q_bid + q_ask)
return I * ask + (1 - I) * bid
def p_uptick(q_bid, q_ask, n_sims=20_000, seed=0):
"""Queue-race model: each event moves one queue by +/-1; up if the ask queue empties first."""
rng = np.random.default_rng(seed)
ups = 0
for _ in range(n_sims):
b, a = q_bid, q_ask
while a > 0 and b > 0:
step = 1 if rng.random() < 0.5 else -1
if rng.random() < 0.5: a += step
else: b += step
ups += a == 0
return ups / n_sims
print(weighted_mid(99.99, 100.01, 8, 2)) # 100.006
print(p_uptick(8, 2)) # ≈ 0.83Making it a martingale
The weighted mid has a flaw: it isn’t a martingale. When the thin ask is taken out and the price ticks up, the new ask queue is often large and the new bid queue small, so the weighted mid can jump back down. A fair-value estimate shouldn’t predictably reverse.
Stoikov’s microprice fixes this by estimating, from data, the expected mid after the next several price changes, conditional on the current imbalance and spread (discretised into buckets), and taking the limit. The result is a martingale, it lies within the spread, and empirically it forecasts short-term prices better than both the mid and the weighted mid.
Uses:
- Market making: quote around the microprice, not the mid, to avoid being picked off on the thin side (the Avellaneda–Stoikov reservation price then adds an inventory lean on top).
- Execution: don’t post a passive buy order on the bid when the ask is about to disappear; you’ll miss the fill and chase the price.
- Short-horizon signals: imbalance is among the most reliable predictors of the next tick, though the move is small relative to costs for anyone who has to cross the spread.
Where people slip in interviews
- Weighting the wrong way. A big bid queue pushes fair value up, towards the ask: the weight on the ask price is the bid share, .
- Treating the signal as free money. Imbalance predicts moves smaller than the spread; you only profit if you’re already providing liquidity or need to trade anyway.
- Trusting displayed size. Queues can be spoofed or hide iceberg orders; imbalance features are noisy and can be gamed.
- Ignoring the spread. With a wide spread, a new order can land inside it, so the queue-race intuition is weaker.
Try these before you open the answer
Warm-upBid 50.00 for 300 shares, ask 50.02 for 100 shares. What's the weighted mid?Show answer
. Weighted mid .
ShiftWith a one-tick spread s and imbalance I, how far is the weighted mid from the mid?Show answer
. At I = 0.5 it’s zero; at I = 1 it’s half a spread, sitting on the ask.
ModelIn the queue-race model, why must P(up) be the average of its four neighbours?Show answer
The next event moves to one of four neighbouring states, (a ± 1, b) or (a, b ± 1), each with probability 1/4, and the eventual outcome is decided only by where the walk goes from there. Conditioning on the first step gives the average (this is first-step analysis).
SymmetryIn that model, what's P(up) when the two queues are equal?Show answer
Exactly 1/2, by symmetry: swapping the roles of bid and ask maps up-moves to down-moves.
StretchWhy isn't the weighted mid a martingale, and why should a fair-value estimate be one?Show answer
After the thin side is cleared, the next level’s queues are typically unbalanced the other way, so the weighted mid tends to bounce back: its future changes are predictable from its current state. A fair-value estimate is a conditional expectation of future prices, and by the tower property conditional expectations are martingales. If your estimate predictably moves, it isn’t using all the information it has.
The queue-race probabilities were checked by Monte Carlo for several queue pairs; the figure solves the model’s boundary-value problem exactly on a 60 × 60 grid in your browser.