How to calculate microprice from bid and ask
≈commoditisedStart with the size-weighted mid, then Stoikov’s micro-price, the expected future mid given imbalance and spread. Both formulas and a worked example.
See it move
What to notice. Make the bid queue heavier and the microprice slides toward the ask: trades are then more likely to lift the offer than hit the bid. The simple mid never moves; the microprice leans toward where price is about to go.
What is the microprice?
To calculate the weighted mid, weight the best ask by the bid size and the best bid by the ask size, then divide by the total size; the micro-price goes one step further, as below. The microprice is an estimate of fair value that corrects the mid-price for order-book imbalance. The mid, halfway between the best bid and the best ask, treats both sides of the touch as equally strong. They rarely are. If 5,000 lots rest on the bid and only 200 on the ask, the buyers are likely to consume the thin offer and tick the price up, so a fair value that ignores the imbalance sits too low.
Stoikov (2018) defines it as the mid plus a correction for which way the book is leaning. It formalises what a trader does by eye when glancing at the sizes on each side of the touch and calling the likely direction of the next price change. The paper fits it on Bank of America, a large-tick stock, and Chevron, a small-tick stock, using quotes from March 2011, and checks it out of sample against the average 1, 5 and 10 minute changes in the mid.
It pairs with order-flow imbalance. OFI measures the flow of imbalance over a window; the microprice reads the static imbalance, the sizes resting now. Same raw information, used for two halves of a maker's job: where to centre quotes (the microprice) and when to widen (OFI and toxicity).
Mid, weighted mid or microprice?
Three fair values can be read off the top of the book, and they treat size differently. The mid-price ignores it. A book with 5,000 × 200 has the same mid as one with 200 × 5,000, though the two predict opposite next moves.
The weighted mid is the linear correction, credited by Stoikov to Gatheral and Oomen. It weights each side's price by the opposite side's size, so a big bid pulls fair value toward the ask. With imbalance , it moves linearly in : at it is the mid, at the ask, at the bid. It is better than the mid, but Stoikov's slides call it "not a martingale" and noisy, and give a counter-intuitive example: with 9 lots on the bid and 1 on the offer, cancelling the single offered lot moves the weighted mid down, although the ask has just become weaker.
The microprice replaces the straight line with a function fitted to the data. In Stoikov's own BAC and CVX fits the adjustment came out smaller than the weighted mid's at every imbalance level, so on a bid-heavy book the micro-price sat between the mid and the weighted mid. For BAC with a one-tick spread it lies just inside the weighted-mid line; with a two-tick spread it is about half the weighted-mid adjustment at the extremes; for CVX it is far inside, roughly 0.0023 against 0.005 at . What the fit buys is not a bigger adjustment but a better-behaved one, with the martingale property and a better short-term forecast.
The weighted mid is the microprice with a straight line, , in place of the fitted curve. Stoikov's abstract reports that the micro-price is a better short-term predictor than either the mid or the weighted mid.
Why quote around the microprice?
A maker centred on the microprice posts a bid and ask that already lean with the book, so it is less often the stale offer in a rising market. That makes the microprice a natural centre for a maker's quotes.
A maker quoting symmetrically around the mid posts its ask too cheap whenever the book is bid-heavy. At the price is more likely to tick up, and a maker centred on the mid gets lifted just before the uptick, a textbook adverse-selection loss. Centred on the microprice, the ask is pulled up toward where price is going.
The microprice is the fair-value half of a quote. Inventory skew comes from the Avellaneda–Stoikov reservation price (Avellaneda and Stoikov 2008), and the half-spread covers inventory cost plus an adverse-selection term, as laid out in the order-flow and information guide.
It is also a toxicity signal in disguise. A microprice that has pulled far from the mid says one side is likely to win. A maker watches the gap between microprice and mid as it watches OFI and VPIN, as a reason to widen, skew or pull on the exposed side.
The evidence that imbalance predicts anything is real, and strongest where ticks are large. Across 10 liquid Nasdaq stocks, Gould and Bonart (2016) find that queue imbalance gives "a considerable improvement" in predicting the direction of the next mid move for large-tick stocks and "a moderate improvement" for small-tick stocks. Lipton, Pesavento and Sotiropoulos (2013) had earlier modelled the probability of the next price move as a function of quote imbalance at the top of the book.
Why is it the right fair value?
Because it is a target, not a blend. Stoikov defines the microprice as the expected future mid-price, conditional on the current imbalance and spread, pushed far enough ahead that the current imbalance has washed out. It is your best guess of where the mid will be once the lopsidedness has played out.
That construction gives it the martingale property: standing at the microprice, the expected next change is zero, because the predictable drift from the current imbalance is already priced in. From the mid, the expected next move is not zero when the book is imbalanced. The slides list the features as Markov, martingale, fast to compute, and better short-term predictions. The estimator is also horizon independent in practice: the notebook that accompanies the paper finds that "the distant future is well captured by" the expected mid price after 6 price moves.
▸ Show the microprice derivation optional
Stoikov (2018) models the pair (spread and imbalance) as a Markov process, with the mid moving by ticks at transition times and its dynamics independent of the level of . The microprice is the expected mid arbitrarily far ahead, conditional on the current observable book state.
Because imbalance mean-reverts (a one-sided book resolves), the limit exists and equals the current mid plus an adjustment , the accumulated expected mid-move attributable to the current imbalance.
The first-step adjustment comes from an absorbing Markov chain on the book states, and later steps follow a recursion in which each adjustment is the previous one propagated through the transition matrix. After symmetrising the data, the recursion converges. Dividing by half the spread normalises the adjustment.
The martingale property pins this down as the fair value, just as the Glosten–Milgrom quotes are pinned down as conditional expectations of value given order direction.
The construction assumes is a useful, roughly Markov summary and that imbalance mean-reverts. That is a fair approximation for liquid, large-tick names and weaker in very thin books or gappy prediction markets. The principle is general; the fitted is specific to a venue and must be re-estimated, not copied. A curve fitted to your own venue's data is where the work and the edge sit.
Worked example: reading three fair values off one book
Take an illustrative book, which you can reproduce in the interactive above. The best bid is 100.00 and the best ask 100.02, so the spread is and the half-spread is 0.01. Bid size is lots and ask size lots, giving imbalance , strongly bid-heavy.
The mid is , ignoring the 4:1 imbalance. The weighted mid is , which is 0.6 of the way from the mid to the ask. For the microprice, suppose a fit for this made-up instrument gives, at , . Then . That one hypothetical value happens to land above the weighted mid. It is not Stoikov's finding: in his BAC and CVX fits the micro-price came out between the mid and the weighted mid, so a fitted on a real stock would more likely give a number below 0.6 here.
The maker's takeaway. A maker centred on the mid (100.010) quotes an ask near 100.015, too cheap, and gets lifted just before the uptick. A maker centred on the microprice (100.018) quotes its ask near 100.023, so it is not the stale cheap offer and is picked off less. The quotes sit at sub-tick prices inside a 0.02 spread, which suits an illustrative instrument but not a US stock with a penny tick. Same spread width, different realised P&L.
The forecast-error check. Track each estimator's error against the realised next mid-move on a simulated tape with informed flow switched on. The average squared error ranks , consistent with the better short-term prediction reported in Stoikov's abstract.
Now balance the book. Set so . All three collapse to the mid, 100.010, because there is nothing to forecast and . The microprice earns its keep only in lopsided books, and the fitted curve needs to be re-estimated for each instrument and venue.
Sources
- Stoikov, S. (2018). "The micro-price: a high-frequency estimator of future prices". Quantitative Finance 18(12), 1959–1966. doi.org
- Gould, M. D. and Bonart, J. (2016). "Queue imbalance as a one-tick-ahead price predictor in a limit order book". Market Microstructure and Liquidity 2(2), 1650006. arxiv.org
- Lipton, A., Pesavento, U. and Sotiropoulos, M. G. (2013). "Trade arrival dynamics and quote imbalance in a limit order book". arXiv:1312.0514. arxiv.org
- Avellaneda, M. and Stoikov, S. (2008). "High-frequency trading in a limit order book". Quantitative Finance 8(3), 217–224. doi.org
- Stoikov, S. "The Micro-Price" (slides, Gatheral 60th birthday conference). imperial.ac.uk
- Stoikov, S. "microprice" (code, BAC and CVX data for March 2011, and accompanying notebook). github.com