Basic Prerequisites: 05 · Failure Modes & Practice and Queue Position: 06 · Advanced Extensions.
1. Intuition & Practical Objective
The previous pages built an honest fill model and a Monte Carlo engine. This page is the launchpad for the simulators used at the frontier - and for the test that decides whether any of them is trustworthy:
- Agent-based LOB simulation - generate the whole book from agent behaviours (Abergel et al.), so that fills, impact, and liquidity emerge rather than being assumed.
- Queue-reactive and Hawkes models - make the intensities state-dependent and self-exciting, so the generator reproduces the correlation structure of real flow.
- Simulator validation against stylized facts - the non-negotiable acceptance test: the simulator must reproduce the empirical regularities (Roll bounce, square-root impact, concave depth, U-shaped volume) before any counterfactual is believed.
- Generative and ML order-book models - deep generators and signature methods that learn the joint law of the book; powerful and dangerous.
The unifying discipline is simple: a simulator earns trust only by reproducing what the market already tells us is true.
2. Mathematical Ground Truth & Derivations
2.1 Validation #1 - the Roll bid-ask bounce (a spread test)
A simulator with a realistic matching process produces trade prices (efficient price half-spread). The Roll signature is a negative first-order autocovariance of price changes:
so the simulator’s own output must yield equal to the spread it was built with. Fail this and the simulator’s fill prices are wrong even if its fills are right.
2.2 Validation #2 - the square-root impact law (an impact test)
Metaorder impact is concave in participation. The empirical form (Almgren et al. 2005; the “square-root law”) is
with the order size, the market volume, the volatility, and a constant of order one. A simulator that reproduces this exponent is credible for sizing; one that produces a linear law is not. The exponent is recovered by a log–log regression: .
2.3 Validation #3 - queue-reactive intensities (a depth-correlation test)
Real limit-order intensity and market-order intensity are both increasing and concave in the queue size (Huang–Lehalle–Rosenbaum):
the quantitative content of “liquidity begets liquidity.” A generator with constant intensities produces too-smooth depth and mis-prices every fill near the front.
2.4 The stylized-facts checklist
A credible execution simulator must reproduce, at minimum: (i) the negative return autocorrelation / Roll spread; (ii) the concave square-root impact; (iii) the concave depth–intensity relation and the hump-shaped depth-vs-distance profile; (iv) the intraday U-shaped volume curve; (v) fat-tailed trade sizes and the high cancel-to-trade ratio. Each is a falsifiable acceptance criterion - the only defence against the model risk that Monte Carlo imports (page 04).
2.5 What the frontier adds
- Agent-based LOB (Abergel et al.): heterogeneous agents (market makers, takers, informed) whose interaction builds the book; fills and impact are emergent. Cost: calibration and compute.
- Queue-reactive / Hawkes: state-dependent, self-exciting intensities reproduce order-flow clustering; used both as a fill model and as the generator.
- Generative LOB models: sequence models and signature-based generators that learn from L2/L3 data (López de Prado’s “backtesting on synthetic data”, AFML Ch 13); highest fidelity, highest overfitting and non-stationarity risk.
3. Computational Implementation - validating a simulator against stylized facts
Stdlib + numpy. Three acceptance tests: the Roll spread is recovered from simulated trade prices; the square-root impact exponent is recovered by log–log fit (and beats a linear model); the queue-reactive intensity is concave.
The three tests pass. (1) The simulator’s trade prices carry the exact Roll signature: the recovered half-spread matches the built-in (spread vs ) - the same recovery Hasbrouck applies to PCO data. (2) The square-root generator is recovered with exponent against a theory of , and the concave law fits far better than a linear model on levels ( vs ) - the simulator is credible for impact sizing, and a linear-impact assumption is demonstrably rejected. (3) The queue-reactive intensity is increasing and concave (from to with clear saturation) - the depth-correlation stylized fact is present. A simulator that passes these three earns the right to answer counterfactuals; one that fails them is a random-number generator with a confident attitude.
4. Failure Modes & First-Principles Breakdowns
- Model risk smuggled in as precision. A Monte Carlo interval is only as meaningful as the generator; a tight CI around a mis-specified model is worse than an honest single replay because it looks rigorous (page 04, Backtesting Hygiene).
- Validation leakage. Calibrating the generator and testing the stylized facts on the same data guarantees a pass; the tests must run out-of-sample (different days, different names, different regime).
- Matching the wrong stylized facts. Reproducing the U-shaped volume but missing the cancel-to-trade ratio leaves fills too optimistic; the checklist must be complete and the facts empirically sourced, not assumed.
- Non-stationarity. LOB generators are fit on a regime; execution behaviour changes with volatility, tick size, and fee structure. A generator validated in calm markets can be badly wrong in a stress regime - the very regime where execution P&L is decided.
- Generative models interpolate, they do not extrapolate. Deep LOB generators (and signature methods) learn the empirical law of the book; they are silent on counterfactuals outside the training distribution (a new venue, a much larger order, a fee change). Their counterfactuals are trustworthy only inside the support.
- Compute and calibration cost as a hidden bias. An agent-based simulator expensive enough that it is only ever run on a handful of scenarios silently reverts to replay-like single-path behaviour - losing the distributional benefit that justified it.
- Validation as an afterthought. Teams validate the fill model and forget the impact and spread models; the three are independent acceptance tests, and passing two is not passing.
5. References
- Abergel, F.; Anane, M.; Chakraborti, A.; Jedidi, H.; Toke, I. M. - Limit Order Books (Cambridge, 2016)
- Huang, W.; Lehalle, C.-A.; Rosenbaum, M. - “Simulating and analyzing order book data: the queue-reactive model,” JASA 110(509), 107–122 (2015)
- Almgren, R.; Thum, C.; Hauptmann, E.; Li, H. - “Direct estimation of equity market impact,” Risk 18(7), 58–62 (2005)
- Gatheral, J. - “No-dynamic-arbitrage and market impact,” Quantitative Finance 10(7) (2010)
- Cont, Stoikov & Talreja - “A stochastic model for order book dynamics,” Operations Research 58(3) (2010)
- Gould et al. - “Limit order books,” Quantitative Finance 13(11) (2013)
- López de Prado, M. - Advances in Financial Machine Learning (Wiley, 2018)
- Hasbrouck, J. - Empirical Market Microstructure
6. Connected Graph Bridges
- Back: 05 · Failure Modes & Practice · Index Hub
- Sibling in-pillar: Queue Position: 06 · Advanced Extensions · Optimal Execution & Almgren–Chriss · Execution Algorithms: VWAP, TWAP, POV
- Impact & market-making: Market Impact & Depth · Limit Order Book Mechanics
- Foundations: Econometrics & Time Series (Roll autocovariance, power-law estimation) · Backtesting Hygiene