Ask almost anyone for the "price" of an instrument and they will give you the mid: the average of the best bid and the best ask. It is symmetric, easy to compute, and in a large-tick market it is a poor estimate of fair value. When the best bid has 4,000 lots resting and the best ask has 40, every participant watching the book knows which side gives way first. The mid ignores that.
This article goes through the standard toolkit for reading the top of the book: queue imbalance, order flow imbalance (OFI), the weighted mid and Stoikov's micro-price. We define each one, estimate each one on a simulated limit order book whose ground truth we control, and then cover what the papers spend less time on: a signal that predicts the next tick with 78% accuracy can still lose more than a tick on every trade.
All numbers below come from a simulated order book with fixed seeds. None of them are real market statistics. The code is complete, and it runs top to bottom with only numpy.
1. Notation and the problem with the mid
Work in units of ticks and lots. At event time the top of the book is the tuple
with best bid and ask prices and the visible size resting at each, . Define
is the queue imbalance. Some authors use the centred version . The two carry the same information.
A good fair-value estimator should be a martingale: given everything visible now, its expected future value should equal its current value. The mid fails this test as soon as queue sizes carry information about which side depletes first. The reason is mechanical. In a market with a one-tick spread, the mid moves only when one of the two queues is exhausted (or when someone improves inside a wider spread). If the ask queue is much smaller than the bid queue, the ask is more likely to go first, so
where is the time of the next mid change. The mid is biased in a predictable direction, and the bias is a function of observable state.
This matters most in large-tick assets: instruments where the tick is large relative to the price's natural volatility, so the spread sits at one tick nearly all the time and queues are long. Short-dated government bond futures, many equity index futures, and low-priced stocks with heavy volume all look like this. In such markets the price is effectively a discrete process, and nearly all of its short-horizon information sits in the queues. In small-tick assets the spread is several ticks wide and changes constantly. Queues are thin and get refreshed within the spread, so says much less. We return to this distinction in Section 7.
2. A simulated book with known structure
To evaluate an estimator, we need data where the correct answer is known. We simulate an event-driven, Level-1 book in the spirit of the Markovian queue models of Cont and de Larrard and the queue-reactive model of Huang, Lehalle and Rosenbaum, simplified to a single level per side:
- limit orders join the best bid and best ask at rate each;
- each resting lot is cancelled at rate , so total cancellation intensity is ;
- market orders arrive at rate per side, with geometric size;
- when the spread exceeds one tick, new limit orders improve it at rate per side, starting a new queue of one lot;
- when a queue is exhausted, that side moves one tick away and the new level starts with lots.
The last rule is the one that creates the predictive power. A depleted ask moves up by one tick while the bid stays where it is. The spread becomes two ticks and the mid rises by half a tick. The gap is then filled from one side or the other.
import numpy as np
def simulate_l1(n_events=1_000_000, lam=1.5, lam_in=2.0, mu=0.6,
theta=0.08, p_size=0.6, refill_mean=4.0, seed=7):
"""Event-driven L1 book in integer ticks and integer lots.
Events: limit arrivals at best bid/ask (rate lam each), cancellations
(theta per resting lot), market orders (rate mu per side, geometric size),
and, when the spread exceeds one tick, limit orders inside the spread
(rate lam_in per side). A depleted queue moves that side one tick away;
the new level's queue is 1 + Poisson(refill_mean).
"""
rng = np.random.default_rng(seed)
b, a, qb, qa, t = 0, 1, 5, 5, 0.0
T = np.empty(n_events); B = np.empty(n_events, np.int64)
A = np.empty(n_events, np.int64)
QB = np.empty(n_events, np.int64); QA = np.empty(n_events, np.int64)
for n in range(n_events):
inside = lam_in if a - b > 1 else 0.0
rates = np.array([lam, lam, theta*qb, theta*qa, mu, mu, inside, inside])
total = rates.sum()
t += rng.exponential(1.0 / total)
k = rng.choice(8, p=rates / total)
if k == 0: qb += 1 # limit buy at bid
elif k == 1: qa += 1 # limit sell at ask
elif k == 2: qb -= 1 # cancel at bid
elif k == 3: qa -= 1 # cancel at ask
elif k == 4: qa -= min(qa, rng.geometric(p_size)) # market buy
elif k == 5: qb -= min(qb, rng.geometric(p_size)) # market sell
elif k == 6: b, qb = b + 1, 1 # new bid inside spread
else: a, qa = a - 1, 1 # new ask inside spread
if qa == 0: a, qa = a + 1, 1 + rng.poisson(refill_mean)
if qb == 0: b, qb = b - 1, 1 + rng.poisson(refill_mean)
T[n], B[n], A[n], QB[n], QA[n] = t, b, a, qb, qa
return T, B, A, QB, QA
T, B, A, QB, QA = simulate_l1()
M = 0.5 * (A + B) # mid, in ticks
S = A - B # spread, in ticks
I = QB / (QB + QA) # queue imbalance in (0, 1)
print(f"events={len(T):,} clock time={T[-1]:,.0f}")
print("spread distribution:", {s: round(float(np.mean(S == s)), 3) for s in (1, 2, 3)})
print(f"mean L1 queue={0.5*(QB+QA).mean():.2f} lots, mid moves={np.count_nonzero(np.diff(M)):,}")
events=1,000,000 clock time=182,611
spread distribution: {1: 0.943, 2: 0.055, 3: 0.002}
mean L1 queue=7.30 lots, mid moves=50,354
This is a large-tick market by construction. The spread is one tick 94.3% of the time, and about one event in twenty moves the mid. The model has no information beyond the queues: no hidden liquidity, no informed flow, no deeper levels. Any predictability we find comes from the queue mechanics alone, which makes it a lower bound on what real books offer and an upper bound on how clean the signal can look.
3. Queue imbalance as a one-tick-ahead predictor
Gould and Bonart (2016) take the most direct approach. Condition on and ask for the probability that the next mid move is up. They fit a logistic regression of the direction of the next mid change on queue imbalance across a cross-section of stocks. They find that the relationship is strong and monotone, and noticeably stronger for large-tick stocks.
Nonparametrically on our simulated book:
# For every event, locate the next event at which the mid changes.
moves = np.flatnonzero(np.diff(M)) + 1 # indices where M changed
nxt = np.searchsorted(moves, np.arange(len(M)), side="right")
ok = nxt < len(moves) # drop the tail with no future move
idx = np.arange(len(M))[ok]
tau = moves[nxt[ok]] # index of first mid change after n
dM = M[tau] - M[idx] # mid change at that move, in ticks
edges = np.linspace(0, 1, 6) # 5 imbalance buckets
sel = S[idx] == 1
bk = np.clip(np.digitize(I[idx], edges) - 1, 0, 4)
print("bucket P(next move up) n")
for j in range(5):
m = sel & (bk == j)
print(f"[{edges[j]:.1f},{edges[j+1]:.1f}) {np.mean(dM[m] > 0):.3f} {m.sum():,}")
| Imbalance | Events | |
|---|---|---|
| [0.0, 0.2) | 0.212 | 56,411 |
| [0.2, 0.4) | 0.352 | 224,831 |
| [0.4, 0.6) | 0.496 | 379,893 |
| [0.6, 0.8) | 0.633 | 210,885 |
| [0.8, 1.0) | 0.767 | 70,584 |
The curve is close to linear in the middle and flattens towards the edges. That shape is what makes a logistic link fit well. One way to see where the shape comes from: in the simplest Cont–de Larrard setting, with balanced order flow and the two queues behaving as independent random walks, the probability that the bid outlives the ask is a smooth increasing function of .
Queue imbalance answers a narrow question: which side moves first? It says nothing about when, or about how far the price travels after the first move. Both of those determine whether the signal can be traded.
4. Order flow imbalance and linear price impact
Queue imbalance is a state variable. Cont, Kukanov and Stoikov (2014) look instead at the flow that changes the state. Their key observation is that market orders, limit orders and cancellations at the best quotes all change and , and their net effect on price can be captured by a single quantity. Between consecutive book updates and , define
Read it term by term. If the bid price is unchanged, the first two terms give : bid-side additions count as buying pressure, and cancellations or sells into the bid count as selling pressure. If the bid moves up, the whole new queue counts as buying pressure. If it moves down, the whole old queue counts as removed. The ask side is mirrored with the opposite sign. Summing over an interval gives
and the empirical finding is a linear relation with a depth-dependent slope:
where is the average depth at the best quotes over the interval. The scaling is intuitive in a stylised book where every level holds roughly lots. Moving the price by one tick requires removing about lots of net flow, so the price change per lot of imbalance is about ticks. Cont, Kukanov and Stoikov derive this from a simple model and confirm it empirically across a cross-section of US equities. They also show that OFI explains much more of the price change than signed trade volume alone. That is the point of the paper: cancellations and limit orders move prices as much as trades do.
def ofi_events(B, A, QB, QA):
"""Per-event order flow imbalance e_n (Cont, Kukanov & Stoikov 2014)."""
b0, b1, a0, a1 = B[:-1], B[1:], A[:-1], A[1:]
qb0, qb1, qa0, qa1 = QB[:-1], QB[1:], QA[:-1], QA[1:]
return ((b1 >= b0) * qb1 - (b1 <= b0) * qb0
- (a1 <= a0) * qa1 + (a1 >= a0) * qa0)
e = ofi_events(B, A, QB, QA)
win = np.floor(T[1:] / 50.0).astype(int) # 50-time-unit windows
nw = win.max() + 1
OFI = np.bincount(win, weights=e, minlength=nw)
first = np.searchsorted(win, np.arange(nw)) # first event in each window
last = np.r_[first[1:], len(win)] - 1
dMw = M[1:][last] - M[:-1][first] # mid change over the window
depth = np.bincount(win, weights=0.5*(QB[1:]+QA[1:]), minlength=nw) / np.bincount(win, minlength=nw)
def ols(x, y):
X = np.column_stack([np.ones_like(x), x])
coef, *_ = np.linalg.lstsq(X, y, rcond=None)
r2 = 1 - np.sum((y - X @ coef)**2) / np.sum((y - y.mean())**2)
return coef, r2
(c, beta), r2 = ols(OFI, dMw)
print(f"windows={nw:,} beta={beta:.4f} ticks/lot R^2={r2:.3f}")
print(f"corr(dM, OFI)={np.corrcoef(dMw, OFI)[0,1]:.3f}")
print("depth bucket mean depth beta beta*depth")
for lo, hi in [(0, 6.5), (6.5, 7.5), (7.5, 8.5), (8.5, 99)]:
m = (depth >= lo) & (depth < hi)
(_, bj), _ = ols(OFI[m], dMw[m])
print(f"[{lo:>4},{hi:>4}) {depth[m].mean():5.2f} {bj:.4f} {bj*depth[m].mean():.3f}")
Over 3,653 windows, the pooled regression gives ticks per lot with . Splitting the windows by average depth:
| Depth bucket (lots) | Mean depth | (ticks/lot) | depth |
|---|---|---|---|
| < 6.5 | 5.64 | 0.0759 | 0.428 |
| 6.5–7.5 | 6.97 | 0.0647 | 0.451 |
| 7.5–8.5 | 7.96 | 0.0550 | 0.438 |
| ≥ 8.5 | 9.75 | 0.0447 | 0.436 |
The slope falls by about 40% from the thinnest to the deepest bucket, while stays within a narrow band around 0.44. This is the law, reproduced from nothing but queue mechanics.
Three caveats apply before using this in practice.
- OFI is contemporaneous. The regression explains the price change over the same window in which the flow occurred. That is a statement about price formation and impact, not a forecast. Lagged OFI has much weaker predictive power. Much of what it has comes from the persistence of order flow, which is a separate phenomenon.
- Depth normalisation matters across regimes. Pooling a session where depth varies by a factor of five into one mixes slopes that differ by a factor of five. Normalise OFI by depth, or fit conditional on depth, before comparing across days or instruments.
- Multi-level OFI. The L1 definition ignores everything behind the best quotes. Extensions that aggregate OFI across several levels, with weights or a principal-component projection, typically raise the explained variance. They also add more ways to overfit.
5. The weighted mid and why it is not enough
The obvious improvement on the mid is to tilt it toward the side that is about to give way:
When the bid queue dominates (), moves toward the ask. That is the right direction. But the weighted mid has two structural flaws.
It is not a martingale. The adjustment is linear in with a slope fixed at the spread. Nothing guarantees that it equals the true conditional expectation of the future price. Usually it overshoots: in our model, at with a one-tick spread, it claims fair value sits ticks above the mid, while the realised expectation at the next move is smaller (Section 6). With a two-tick spread the overshoot is extreme. The weighted mid doubles its adjustment just because doubled, but a wide spread here is a transient state that is usually closed by a one-lot order inside the gap. In that state the queue sizes on the outside quotes say very little.
It jumps with queue depletion. Consider the ask queue shrinking from 2 lots to 1 to 0 against a bid of 10. Just before depletion . One event later the ask has moved up a tick with a fresh queue, and is recomputed from scratch. jumps by an amount unrelated to any change in fundamental value, because its formula breaks at the boundary where a queue resets. The micro-price is built to avoid this artefact: it targets the expected price after the move, so it already prices the reset in.
6. Stoikov's micro-price
Stoikov (2018) defines fair value as the limit of expected future mids, sampled at the times the mid changes:
where are the successive mid-change times. Under the assumption that the book state is Markov and the dynamics are invariant to the price level, this limit telescopes into an additive series:
In matrix form, with discretised to states, , where is the distribution of the state just after the next mid move. Stoikov builds from the one-step transition matrices, separating transient transitions (the mid does not move) from absorbing ones (the mid moves) and inverting the transient block. Since we have the full simulated path, we can estimate directly by counting.
The first-order term is the expected mid change at the next mid move, conditional on the current imbalance bucket and spread. It is easy to estimate: bucket the data and average within each bucket. Many practitioners stop here. The higher-order terms add the information that, after the next move, the book will be in a new state that is itself informative. For instance, a depleted ask is replaced by a level whose queue starts small.
Two practical details from the paper carry over directly.
- Symmetrise. If the dynamics are symmetric under with the price direction flipped, add the mirrored copy of every observation. This halves the noise and guarantees at . It also removes any sample drift, without which would not converge.
- Condition on the spread. The spread is part of the state, not a scale factor. A two-tick spread is a different regime, not a stretched one-tick spread.
NI, SPREADS = 5, (1, 2) # 5 imbalance buckets x 2 spread states
def state(i, s):
"""Discrete state id; spreads of 3+ ticks are merged into the 2-tick state."""
return np.minimum(s, 2) - 1 + len(SPREADS) * np.clip((i * NI).astype(int), 0, NI - 1)
x_now = state(I[idx], S[idx]) # state at event n
x_aft = state(I[tau], S[tau]) # state right after the next mid move
K = NI * len(SPREADS)
# Symmetrise (I -> 1-I, dM -> -dM): the model is symmetric, so this halves the noise.
mirror = lambda x: (x % 2) + 2 * (NI - 1 - x // 2)
xs, xa = np.r_[x_now, mirror(x_now)], np.r_[x_aft, mirror(x_aft)]
dMs = np.r_[dM, -dM]
cnt = np.bincount(xs, minlength=K)
g1 = np.bincount(xs, weights=dMs, minlength=K) / cnt # E[M_tau1 - M_t | x]
Bmat = np.zeros((K, K)); np.add.at(Bmat, (xs, xa), 1.0)
Bmat /= Bmat.sum(axis=1, keepdims=True) # P(x_tau1 = y | x_t = x)
g, terms = g1.copy(), [g1]
for _ in range(30): # g_{k+1} = B g_k
terms.append(Bmat @ terms[-1]); g += terms[-1]
print("max |g_k| for k=1..5:", [f"{np.abs(t).max():.4f}" for t in terms[:5]])
print("spread I-bucket W - M g1 micro - M")
for s in SPREADS:
for j in range(NI):
k = (s - 1) + 2 * j
w = ((j + 0.5) / NI - 0.5) * s # weighted-mid offset at bucket centre
print(f" {s} [{j/NI:.1f},{(j+1)/NI:.1f}) {w:+.3f} {g1[k]:+.3f} {g[k]:+.3f}")
The series converges quickly. The largest over states is 0.277, 0.089, 0.016, 0.005 and 0.001 ticks for . The adjustment table, in ticks relative to the mid:
| Spread | bucket | Weighted mid | First order | Micro-price |
|---|---|---|---|---|
| 1 | [0.0, 0.2) | −0.400 | −0.276 | −0.302 |
| 1 | [0.2, 0.4) | −0.200 | −0.137 | −0.149 |
| 1 | [0.4, 0.6) | 0.000 | 0.000 | 0.000 |
| 1 | [0.6, 0.8) | +0.200 | +0.137 | +0.149 |
| 1 | [0.8, 1.0) | +0.400 | +0.276 | +0.302 |
| 2 | [0.0, 0.2) | −0.800 | −0.036 | −0.136 |
| 2 | [0.2, 0.4) | −0.400 | −0.016 | −0.053 |
| 2 | [0.4, 0.6) | 0.000 | 0.000 | 0.000 |
| 2 | [0.6, 0.8) | +0.400 | +0.016 | +0.053 |
| 2 | [0.8, 1.0) | +0.800 | +0.036 | +0.136 |
The weighted-mid column is evaluated at bucket centres. Three things stand out.
- With a one-tick spread, the weighted mid overshoots by about a third. At extreme imbalance it puts fair value 0.40 ticks from the mid. The micro-price says 0.30.
- With a two-tick spread, the weighted mid is wrong by a factor of six. It moves fair value 0.8 ticks toward the heavy side. The micro-price moves 0.14. The first-order term is almost flat (0.036): the next mid move will almost certainly come from an order improving inside the gap, which is roughly a coin flip in this model. The information only appears at second order. Once the gap closes, the book is back to a one-tick state whose imbalance is still skewed, and that state predicts the move after.
- Higher-order terms are not negligible in the wide-spread state. captures most of the adjustment at (0.276 of 0.302). At it captures about a quarter. If wide spreads are rare in your instrument, the first-order micro-price is a decent shortcut. If they are not rare, it is not.
Now evaluate each estimator against the mid at the next mid change, and check the martingale property directly by looking at each estimator's drift between and :
W = B + I * S # weighted mid (= I*ask + (1-I)*bid)
P_micro = M + g[state(I, S)] # micro-price, all terms
P_g1 = M + g1[state(I, S)] # first-order micro-price
target = M[tau] # mid at the next mid change
for name, P in [("mid", M), ("weighted mid", W), ("micro (g1)", P_g1), ("micro (full)", P_micro)]:
err = target - P[idx]
drift = P[tau] - P[idx] # martingale check at mid-change times
print(f"{name:13s} RMSE={np.sqrt(np.mean(err**2)):.4f} "
f"E[dP | I>0.8, S=1]={drift[(I[idx] > 0.8) & (S[idx] == 1)].mean():+.4f}")
| Estimator | RMSE vs (ticks) | Drift |
|---|---|---|
| Mid | 0.5000 | +0.2775 |
| Weighted mid | 0.4893 | +0.0931 |
| Micro-price, only | 0.4813 | +0.0090 |
| Micro-price, full series | 0.4816 | +0.0035 |
The RMSE column looks unimpressive, and the reason is worth understanding. In this model every mid move is exactly half a tick, so the target is essentially binary, . No estimator built from can remove that irreducible coin-flip variance. All of them are trying to sit at the conditional mean of a two-point distribution. The mid's RMSE of exactly 0.5000 is the signature of this. The weighted mid even loses on RMSE to the first-order micro-price, because its errors are biased rather than merely noisy.
The drift column is the more telling diagnostic. Conditional on a heavy bid, the mid drifts up by 0.278 ticks by the next move: the bias we set out to remove. The weighted mid removes two thirds of it but still drifts by 0.093 ticks, so it is not a martingale. The full micro-price drifts by 0.0035 ticks, which is zero to within sampling error. That property is exactly what it was constructed to have. The full series' RMSE is marginally worse than alone, because is fit to minimise one-step error while the full series is fit for consistency over the whole sequence of future moves.
The weighted mid is a heuristic with the right sign. The micro-price is an estimator with the right expectation. The difference only becomes visible once you test the martingale property, not the one-step forecast error.
7. From predictive signal to P&L
This is where most order-book imbalance research quietly stops. Take the strongest signal we have: one-tick spread, , next move up 77.8% of the time, expected mid move of +0.278 ticks. Trade it as naively as possible: buy at the ask, then sell at the bid. Assume zero latency, zero fees and zero market impact.
# Naive taker: buy at the ask when I > 0.8 on a 1-tick spread. Zero latency,
# zero fees, zero impact. Two exits: (a) hit the bid right after the next mid
# change; (b) wait until the spread is back to one tick, then hit the bid.
sig = (I[idx] > 0.8) & (S[idx] == 1)
entry, t1 = A[idx][sig], tau[sig]
one = np.flatnonzero(S == 1)
t2 = one[np.minimum(np.searchsorted(one, t1), len(one) - 1)] # first 1-tick state at/after tau
for name, ex in [("exit at next mid change", B[t1]), ("exit once spread = 1", B[t2])]:
pnl = ex - entry
print(f"{name:24s} mean PnL={pnl.mean():+.3f} ticks win rate={np.mean(pnl > 0):.3f}")
print(f"trades={sig.sum():,} directional hit rate={np.mean(M[t1] > M[idx][sig]):.3f} "
f"mean mid move={np.mean(M[t1] - M[idx][sig]):+.3f} ticks")
| Exit rule | Mean P&L per round trip | Win rate |
|---|---|---|
| Hit the bid right after the next mid change | −1.222 ticks | 0.0% |
| Wait until the spread is back to one tick, then hit the bid | −0.721 ticks | 0.2% |
Across 56,421 signals with a 77.8% directional hit rate, the strategy never makes money at the first exit. The arithmetic is unforgiving. Buying at the ask and selling at the bid costs a full spread, one tick. The signal is worth about 0.28 ticks of mid move. Worse, being right in this model means the ask queue was consumed and the ask moved up while the bid stayed put. The price moved away from the side you have to sell into. Waiting for the gap to close recovers half a tick on average. It still leaves you well below zero.
The simulation is generous. Real deployment adds several further costs:
- Adverse selection on passive fills. The natural fix is to post rather than take: join the bid when is high and earn the spread instead of paying it. But a passive bid fills exactly when sellers arrive, and those fills are concentrated in states where the bid is about to break. Conditional on being filled, the imbalance has usually moved against you. A passive implementation of an imbalance signal is a different strategy with a different P&L distribution, and it must be evaluated on fill-conditional outcomes, not on signal-conditional ones.
- Queue position. In large-tick markets a passive order joins the back of a long queue. Its fill probability and its adverse selection both depend on its position in that queue, which the L1 snapshot does not show. The value of being early in the queue is a large part of the economics of large-tick market making, and it goes to whoever is fastest when a new level opens.
- Latency. Extreme imbalance states are short-lived, because a one- or two-lot queue does not survive long. Every participant with a co-located feed sees the same . The fraction of the 0.28-tick edge left after a round trip from your gateway to the matching engine, behind the fastest participants, is an empirical question. The usual answer is "less than the spread".
- Fees and rebates. In many venues the fee or rebate is comparable in size to the signal. A strategy whose gross edge is a fraction of a tick lives or dies on its fee tier.
None of this makes the micro-price useless. It just means its value lies elsewhere than in directional taking. The productive uses are:
- As the reference price for a market maker. Quoting around instead of systematically skews quotes away from the side about to break. That reduces adverse selection on the maker's own fills.
- As an execution benchmark and timing input. A parent order working through a day can delay taking on the side where the micro-price says the price is about to improve, and take more aggressively when it says the price is about to move away. A fraction of a tick per child order across millions of shares is real money.
- As the mark for short-horizon alpha models. Labels defined on mid changes contain a predictable component that is pure queue mechanics. Measuring returns from the micro-price removes it, so a model learns from something other than the queue imbalance it could have read directly.
- As a cleaner input to volatility and correlation estimates. Mid-based high-frequency returns inherit bid–ask bounce and queue-driven predictability. A martingale price estimate reduces that microstructure noise at the source.
Large tick versus small tick
Everything above is sharpest in a large-tick market: the spread is pinned at one tick, queues are long, the mid moves rarely, and carries most of the short-horizon information. In a small-tick instrument the picture changes:
| Large-tick | Small-tick | |
|---|---|---|
| Spread | Almost always 1 tick | Several ticks, variable |
| Queue size at best | Large, slow to deplete | Small, constantly refreshed |
| What moves the mid | Queue depletion | Quote revisions inside the spread |
| Informativeness of | High | Low; the spread and recent flow matter more |
| Micro-price state | with few spread states | Needs richer state: spread, deeper levels, flow |
In small-tick assets the queue at the best quote is often a single order that will be repriced within milliseconds. Its size says little about which way the price moves. The micro-price framework still applies, but the state must be enriched. Without that, collapses toward zero and the estimator degenerates to the mid, which is the correct answer when the queues hold no information.
8. A short checklist for real data
When you take these estimators from the simulation to an actual feed:
- Sample at book events, not on a clock. The micro-price recursion is defined at mid-change times. Fitting it on a clock grid mixes states that never coexisted.
- Bucket the imbalance with care. Five to ten buckets is plenty. Make sure every (imbalance, spread) cell is populated, or the transition matrix will have empty rows.
- Symmetrise, then verify. Symmetry is an assumption. Fit the unsymmetrised version too, and check that the asymmetry is within noise before you impose it.
- Test the martingale property out of sample. The diagnostic that separates the estimators is by state, on held-out days. RMSE alone will not separate them.
- Treat OFI regressions as impact models, not forecasts, and normalise by depth before pooling across regimes.
- Price every signal at the fill, not at the mid. Simulate passive fills with queue position and adverse selection, or measure taker P&L from the touch. A hit rate quoted without the spread is not a result.
References
- Cont, R., Kukanov, A., and Stoikov, S. (2014). "The Price Impact of Order Book Events." Journal of Financial Econometrics, 12(1).
- Stoikov, S. (2018). "The micro-price: a high-frequency estimator of future prices." Quantitative Finance, 18(12).
- 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).
- Cont, R., and de Larrard, A. (2013). "Price dynamics in a Markovian limit order market." SIAM Journal on Financial Mathematics, 4(1).
- Huang, W., Lehalle, C.-A., and Rosenbaum, M. (2015). "Simulating and analyzing order book data: The queue-reactive model." Journal of the American Statistical Association, 110(509).
- Avellaneda, M., Reed, J., and Stoikov, S. (2011). "Forecasting prices from Level-I quotes in the presence of hidden liquidity." Algorithmic Finance, 1(1).
- Eisler, Z., Bouchaud, J.-P., and Kockelkoren, J. (2012). "The price impact of order book events: market orders, limit orders and cancellations." Quantitative Finance, 12(9).
- Bouchaud, J.-P., Bonart, J., Donier, J., and Gould, M. (2018). Trades, Quotes and Prices: Financial Markets Under the Microscope. Cambridge University Press.
Research and education, not investment advice.