Skip to content
All library documents

Modeling Transaction Costs and Execution in Strategy Backtests

Article QuantStart

Summary

This article explains why a strategy backtest needs to account for commissions and fees, slippage and latency, spreads, liquidity, and market impact. It compares fixed cost assumptions with linear, piecewise linear, and quadratic models: simpler models are easier to implement, while more complex models can better represent costs that vary with trading conditions. Historical transaction costs may improve estimates, though modeling them is challenging, especially for strategies trading large volumes over short periods.

The article also describes how market and limit orders differ in execution certainty and price control, and why order book effects matter particularly for high-frequency strategies. Finally, it warns that daily OHLC values from composite feeds can include outliers or tick errors, making backtests that rely on those extremes less representative of live execution. Higher frequency data or data from a single exchange can help address that limitation. The article offers modeling guidance rather than empirical comparisons of the cost models.

Key ideas

  • Backtests should include commissions, fees, slippage, spreads, and market impact.
  • Fixed cost assumptions are simple but do not reflect changing volatility or liquidity.
  • More complex cost models can better represent nonlinear slippage and market impact, at greater implementation and compute cost.
  • Market orders prioritize immediate execution, while limit orders constrain price but may not fill.
  • Composite daily OHLC data can contain outliers that distort strategies relying on intraday extremes.

Tags

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