Market-Replay Backtesting with Latency and Queue Modeling
Summary
This project overview describes a high-frequency backtesting framework built around tick-level market replay. It reconstructs order books from Level-2 or Level-3 data and models feed and order latency, along with the trader’s queue position, to make simulated fills more representative of live execution. It also supports multi-asset and multi-exchange strategies. The example market maker calculates a reservation price from the midpoint, a forecast, and inventory risk, then places bid and ask limits around that price while managing existing orders.
The central research principle is to validate backtests against live trading over the same period before relying on them for optimization or overfitting analysis. The document explains why both overly optimistic and overly conservative execution assumptions can distort results. It gives a framework description and illustrative algorithm, but no empirical comparison or measured accuracy claim. Reliable replay still depends on suitable data and latency and fill models, so agreement with live results must be established for the particular setup.
Key ideas
- Tick-level replay can incorporate both feed and order latency into high-frequency backtests.
- Order-book reconstruction and queue-position models are used to simulate fills.
- A sample market maker adjusts reservation prices for forecasts and inventory risk.
- Backtests should be checked against live results for the same period before deeper optimization.
- The framework’s realism depends on the supplied market data and execution models.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.