Quantitative Backtesting: Workflow, Modes, and Common Pitfalls
Summary
The document explains backtesting as the simulation of a strategy on historical market data to assess returns, risk, and stability. It outlines a workflow from obtaining and checking data, coding rules, and setting dates, capital, fees, and slippage through simulation, metric analysis, refinement, risk controls, and live validation. It also highlights common sources of misleading results, including poor data quality, corporate-action adjustment issues, look-ahead bias, and overfitting.
For medium- and lower-frequency strategies, it compares stock-selection and portfolio workflows, vectorized calculations using time-by-asset matrices, and sequential bar-by-bar simulation. It notes speed and implementation tradeoffs, including vectorization’s risk of accidentally using future information and bar-by-bar testing’s closer fit to trading sequence. Intraday and algorithmic strategies may require Level-1 or Level-2 data and heavier computation, with parallelization suggested. The discussion is introductory: it gives no comparative benchmark or measured results, and emphasizes that historical simulations cannot establish live performance.
Key ideas
- Backtests simulate strategy rules on historical data to examine returns, risk, and stability.
- A typical workflow includes data preparation, strategy coding, simulation settings, performance analysis, refinement, and live validation.
- Data quality, look-ahead bias, and overfitting can make simulated performance misleading.
- Vectorized backtests can be fast but require care to prevent accidental use of future information.
- Sequential bar-by-bar simulation better reflects trading order, while intraday methods may need finer data and more computation.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.