Status of this page: P0 draft. Design guidance. Any claim that a specific fill rule is conservative should be tested against live fills.
1. Data requirements
- Level of detail: trades and top-of-book quotes support aggressive-order simulation. Passive-order simulation needs depth and, ideally, order-level events.
- Timestamps: keep exchange timestamp and local receive timestamp separately; the difference is your latency to the feed.
- Sequencing: ensure the sequence number is monotone and gaps are detected.
- Phases: include opening and closing auction phases and their rules (auction mechanisms).
2. Aggressive (marketable) orders
- Fill against displayed depth at the simulated arrival time (event time plus latency), walking the book.
- Use the book as of arrival, not as of decision; the book may have changed in the latency window.
- Add impact for orders above displayed depth, using a fitted impact curve (market impact and TCA).
3. Passive orders
Three rule families, in increasing realism:
For queue-aware simulation, set the initial position from displayed depth at arrival, and decide a cancellation assumption (none ahead cancels, or a proportional share). Report results under at least a conservative and an optimistic assumption. See queue position and fills.
3.1 Adverse selection in simulation
A simulator that fills by random arrival will not reproduce adverse selection. Use real historical trades so that fills coincide with actual price moves, and measure P&L using the mid some interval after the fill.4. Latency
Model three components: market data latency, strategy compute time, and order entry latency. Apply them as delays on events. Run the same strategy under several latency settings; the P&L-versus-latency curve shows how latency-sensitive the strategy is.5. Own-order impact
Historical data does not contain your orders. Common approximations: reduce displayed depth by your own size after a fill, apply a decay impact model for aggressive orders, and cap participation as a fraction of the observed volume.6. Validation against live
- Run the simulator over a period with live fills.
- Compare simulated and actual fill rates, fill times, and realised spread.
- Adjust only the fill-model parameters (queue assumption, cancellation share), not the strategy.
- Keep the live-versus-sim gap as a standing diagnostic.
Points to verify
- Which HKEX data products carry order-level queue information and the conventions for broker queue data.
- Latency figures for the specific co-location or access setup used.
Sources
- Moallemi and Yuan (2016), A Model for Queue Position Valuation in a Limit Order Book. PDF
- Methodological synthesis for the remaining points.

