Trading strategies·mm-information

How to calculate microprice from bid and ask

≈commoditised
By . Reviewed 24 November 2026. As of 2026: widely known and implemented; the edge is in execution, not the idea.

Start 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

The micropricedrag the queuesIX-MICROPRICE
Best bid100.0000
Best ask100.0200
Simple mid100.0100
Microprice100.0100
Imbalance0.500
bid queue1,500ask queue1,500100.0000100.0200midmicroprice
Bid queue size1,500
Ask queue size1,500

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).

A book heavy on the bid signals incipient buying, so the next price change is more likely up, and fair value should sit above the mid by an amount that grows with the imbalance.
I=QbQb+Qa,pmicro=mid+S2 G(I)I = \frac{Q_b}{Q_b + Q_a}, \qquad p^{\text{micro}} = \text{mid} + \tfrac{S}{2}\,G(I)

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 I=Qb/(Qb+Qa)I = Q_b/(Q_b+Q_a), it moves linearly in II: at I=0.5I=0.5 it is the mid, at I=1I=1 the ask, at I=0I=0 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 G(I)G(I) 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 I=1I=1. 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 mid is blind to imbalance; the weighted mid corrects for it with a straight line; the microprice corrects for it with a curve fitted to how imbalance actually moves the mid.
weighted-mid=pa Qb+pb QaQb+Qa=mid+S2 (2I−1)\text{weighted-mid} = \frac{p_a\,Q_b + p_b\,Q_a}{Q_b + Q_a} = \text{mid} + \tfrac{S}{2}\,(2I - 1)

The weighted mid is the microprice with a straight line, G(I)=2I−1G(I) = 2I-1, 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 I=0.8I=0.8 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.

The microprice is the expected mid arbitrarily far ahead, conditional on the current book state: a price from which the next expected move is zero.
pmicro=lim⁡T→∞E ⁣[ Mt+T∣It, St ],E ⁣[ΔM∣pmicro]=0p^{\text{micro}} = \lim_{T\to\infty} \mathbb{E}\!\left[\,M_{t+T} \mid I_t,\, S_t\,\right], \qquad \mathbb{E}\!\left[\Delta M \mid p^{\text{micro}}\right] = 0
▸ Show the microprice derivation optional

Stoikov (2018) models the pair (St,It)(S_t, I_t) (spread and imbalance) as a Markov process, with the mid MM moving by ticks at transition times and its dynamics independent of the level of MM. The microprice is the expected mid arbitrarily far ahead, conditional on the current observable book state.

pmicro=lim⁡T→∞E ⁣[ Mt+T∣St,It ]p^{\text{micro}} = \lim_{T\to\infty} \mathbb{E}\!\left[\,M_{t+T} \mid S_t, I_t\,\right]

Because imbalance mean-reverts (a one-sided book resolves), the limit exists and equals the current mid plus an adjustment gg, the accumulated expected mid-move attributable to the current imbalance.

pmicro=Mt+g(It,St)p^{\text{micro}} = M_t + g(I_t, S_t)

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.

G(I)=g(I,S)S/2G(I) = \frac{g(I, S)}{S/2}

The martingale property E[ΔM∣pmicro]=0\mathbb{E}[\Delta M \mid p^{\text{micro}}] = 0 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 (I,S)(I, S) 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 GG 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 S=0.02S = 0.02 and the half-spread is 0.01. Bid size is Qb=800Q_b = 800 lots and ask size Qa=200Q_a = 200 lots, giving imbalance I=800/1000=0.80I = 800/1000 = 0.80, strongly bid-heavy.

The mid is (100.00+100.02)/2=100.010(100.00 + 100.02)/2 = 100.010, ignoring the 4:1 imbalance. The weighted mid is (100.02⋅800+100.00⋅200)/1000=100.016(100.02 \cdot 800 + 100.00 \cdot 200)/1000 = 100.016, 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 I=0.80I=0.80, G(0.80)≈0.78G(0.80) \approx 0.78. Then pmicro=100.010+0.01⋅0.78≈100.018p^{\text{micro}} = 100.010 + 0.01 \cdot 0.78 \approx 100.018. 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 GG on a real stock would more likely give a number below 0.6 here.

With the hypothetical G(0.80) of 0.78, the three estimators fan out with the mid lowest and the microprice highest. Real fitted curves can order the last two differently.
100.010⏟mid  <  100.016⏟weighted-mid  <  100.018⏟microprice\underbrace{100.010}_{\text{mid}} \;\lt \; \underbrace{100.016}_{\text{weighted-mid}} \;\lt \; \underbrace{100.018}_{\text{microprice}}

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 microprice<weighted-mid<mid\text{microprice} \lt \text{weighted-mid} \lt \text{mid}, consistent with the better short-term prediction reported in Stoikov's abstract.

Now balance the book. Set Qb=Qa=500Q_b = Q_a = 500 so I=0.5I = 0.5. All three collapse to the mid, 100.010, because there is nothing to forecast and G(0.5)=0G(0.5) = 0. The microprice earns its keep only in lopsided books, and the fitted curve needs to be re-estimated for each instrument and venue.

Sources

  1. Stoikov, S. (2018). "The micro-price: a high-frequency estimator of future prices". Quantitative Finance 18(12), 1959–1966. doi.org
  2. 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
  3. 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
  4. Avellaneda, M. and Stoikov, S. (2008). "High-frequency trading in a limit order book". Quantitative Finance 8(3), 217–224. doi.org
  5. Stoikov, S. "The Micro-Price" (slides, Gatheral 60th birthday conference). imperial.ac.uk
  6. Stoikov, S. "microprice" (code, BAC and CVX data for March 2011, and accompanying notebook). github.com

Where this fits

Common questions

What is the microprice?
The microprice (Stoikov, 2018) is the expected mid-price in the distant future, given the current order-book imbalance and spread: the mid plus a correction estimated from data and built to be a martingale. It is not the weighted mid, (bid × ask size + ask × bid size) / (bid size + ask size), which leans towards the ask when the bid queue is heavier and which Stoikov describes as a noisy signal.