Modeling Order Latency from Feed Timestamps for Backtests
Summary
The guide explains how to create synthetic order latency for more realistic high-frequency backtests when measured order timings are unavailable. It recommends collecting exchange and local timestamps for market data, and says actual order latency can be measured from live trading or from controlled, unfilled orders that are later canceled. As a simplified alternative, it estimates order-entry and response delays from feed latency using separate multipliers and offsets, then constructs request, exchange-arrival, and response timestamps.
The workflow filters records with both timestamp types, resamples them to roughly one-second intervals, calculates feed delay, generates the three order timestamps, and checks for nonpositive component delays. The examples use Bitcoin market data and Python tools, but provide no calibration results or evidence that the chosen parameters represent real execution. The guide explicitly treats order and feed latency as distinct; its proportional model is a convenience and may miss other drivers such as trading activity or event intensity. Empirical latency measurements are preferable when available.
Key ideas
- A realistic backtest should account separately for the time an order reaches the exchange and the response time back to the trader.
- The guide derives feed latency from exchange and local timestamps and resamples observations to about one-second intervals.
- Synthetic order delays are modeled with separate multipliers and offsets applied to feed latency.
- Generated timestamps should be checked for nonpositive entry and response intervals.
- The proportional model is a simplification and requires calibration; order latency need not track feed latency.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.