Skip to content
All library documents

Order-Flow Backtesting for High-Frequency and Grid Strategies

Article FMZ digest · Author: 小草

Summary

The document explains why candle-based backtests can mislead, especially for high-frequency and multi-instrument strategies. Candles omit the timing of trades and bid-ask quotes, making it hard to reconstruct simultaneous prices or realistic fills. They also cannot reproduce price-time queue priority, while strategies with large orders may affect market prices and other participants’ fills. Tick-level replay with depth data can improve timing and matching detail, but it requires large datasets, runs slowly, and still does not capture a strategy’s full market impact.

The proposed alternative uses chronological trade prints and their aggressor side to infer the best bid and ask, then simulates orders against later prints. The rules distinguish maker and taker fills, price priority, partial fills, fees, and order timing. A grid strategy on a perpetual contract illustrates how the method can model order size and sleep interval effects. The results show lower relative returns as order size grows, and a modest change with a shorter interval. The approach remains an approximation: queue position and fill probability at equal prices are omitted, and historical order flow cannot fully reveal counterfactual market impact.

Key ideas

  • Candle data hides trade timing and quote conditions, limiting the accuracy of high-frequency and multi-asset backtests.
  • Trade prints with aggressor direction can be used to approximate the best bid and ask over time.
  • The proposed matching rules simulate maker and taker fills, price priority, partial execution, fees, and strategy timing.
  • The grid example shows that modeled relative returns decline as order size grows, reflecting capacity constraints.
  • The method remains approximate because queue priority, equal-price fill probability, and full market impact are not captured.

Tags

Cited by

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.