hedgefund.wiki — institutional knowledge base

Backtesting

Risk Management · intermediate · CC-BY-4.0

Backtesting is the process of applying a trading strategy, risk model, or investment process to historical data to evaluate how it would have performed in the past, with the dual objectives of validating the model's predictive ability and estimating its expected future performance characteristics such as return, volatility, drawdown, and Sharpe ratio. While backtesting provides essential insight into strategy mechanics and historical behavior, it is subject to numerous biases—look-ahead bias, overfitting, data snooping—that can lead to gross overestimation of real-world performance.

Key takeaways

Explanation

Backtesting is simultaneously one of the most powerful and most dangerous tools in quantitative finance. Its power lies in the ability to evaluate strategy logic across thousands of market environments in minutes, providing far more data than any live track record. Its danger lies in the multitude of ways practitioners (intentionally or unintentionally) introduce biases that make historical results look better than any future realization can hope to match.

Look-ahead bias is the most critical error to eliminate. It occurs when signal construction incorporates information that would not have been available at the point in history when the trading decision is simulated. Common sources include: using adjusted closing prices (which incorporate future stock splits and dividends) without careful treatment; using financial statement data released after the quarter-end to simulate trades at quarter-end; and using end-of-day prices for signals that should use intraday prices. Point-in-time databases (Compustat's CRSP-merged database, Bloomberg's historical revision tracking) exist specifically to provide data as it was actually available on each historical date.

Survivorship bias is the second major error in equity strategy backtesting. A strategy tested only on stocks that are currently in the S&P 500 misses all companies that were in the index at various past dates but subsequently delisted due to bankruptcy, merger, or index removal—typically the worst performers. This systematically inflates historical returns because the worst outcomes are excluded. Studies have estimated that survivorship bias overstates historical returns by 1-3% per year in equity backtests.

The multiple testing problem (data snooping or p-hacking) occurs when researchers evaluate many strategy variations and report only the best performers. If 100 strategy parameterizations are tested at a 5% significance level, 5 will show statistically significant results purely by chance, even if none have genuine predictive power. Controlling for multiple testing requires adjusted significance thresholds (Bonferroni correction, Benjamini-Hochberg FDR), out-of-sample validation, and—ideally—pre-registration of hypotheses before data examination.

Regulatory backtesting under Basel III has a specific technical meaning: comparing a bank's daily VaR estimates to the actual daily P&L. The Basel traffic light system classifies banks based on the number of VaR exceptions (days when actual loss exceeds VaR estimate) over the preceding 250 trading days: green zone (0-4 exceptions, minimum capital surcharge), yellow zone (5-9 exceptions, progressively higher surcharge), red zone (10+ exceptions, automatic highest surcharge). This backtesting framework provides market discipline incentives for accurate VaR model calibration.

Formula

Backtest Sharpe Ratio = Annualized Mean Return / Annualized Standard Deviation
Maximum Drawdown = max(Peak Value - Trough Value) / Peak Value
VaR Backtest Exception Rate = Number of Exceptions / Total Trading Days (expected: α under null)

Example

A quantitative equity team develops a momentum strategy for US mid-cap stocks using 12-month price momentum, rebalancing monthly. Their initial backtest shows a Sharpe ratio of 1.85 and annualized alpha of 6.2% over 2000-2022. Before accepting these results, the team identifies and corrects for: (1) Survivorship bias—adding delisted stocks to the universe reduces alpha by 1.8%; (2) Transaction costs—incorporating 0.15% round-trip for liquid names and 0.30% for illiquid names reduces the Sharpe to 1.42; (3) Implementation lag—using prices two days after signal generation (simulating execution delay) reduces alpha by 0.9%; (4) Market impact—at $200M AUM with a portfolio of 100 stocks, average position size is $2M, which generates estimated market impact of 0.08% per trade. After all adjustments, the realistic Sharpe ratio is approximately 1.10 and alpha is 3.1%—still attractive, but very different from the raw backtest. The out-of-sample period (2020-2022, which was excluded from model development) shows a Sharpe of 0.95, providing reasonable confidence in the adjusted estimates.

Related terms

Alpha Backtesting Framework Basel Iii Black Swan Event Cap Drawdown Equity Market Impact Overfitting Ratio Hedge Sharpe Ratio Signal Generation