Backtesting is a framework that uses historical or simulated data to validate the performance of one or more trading strategies or risk models. Depending on the goals of validation, financial professionals may use more than one indicator or methodology to measure the effectiveness of financial models.
Backtesting in trading
- Backtesting in trading involves: Automating the repeated execution of investment strategies over different historical or simulated time periods
- Aggregating and recording costs
- Generating performance metrics
Backtesters then visualize and report on strategy performance. You can use this approach to validate and compare different investment strategies before selecting one for live trading. In MATLAB®, you can leverage the Backtest framework to evaluate and compare investment strategies.
Common types of backtesting for trading include:
- In-sample vs. out-of-sample testing
- Walk-forward analysis or walk-forward optimization
- Instrument-level analysis vs. portfolio-level assessment
Backtesting for Risk Management
In risk management, backtesting is generally applied to value-at-risk (VaR) or expected shortfall (ES) models, where the approach is known as VaR and ES backtesting, respectively. Expected shortfall provides an estimate of the expected loss on days when there is a VaR failure.
Typical coverage tests for VaR backtesting include Basel's traffic light test, Binomial test, Kupiec’s proportion of failures and time until first failure tests, Christoffersen’s conditional coverage tests, and more.
Typical coverage tests for ES backtesting include commonly cited tests by Acerbi and Szekely, and Du and Escanciano.