Back to Quant Algo Trading
Quant Algo Trading

Backtesting & Monte Carlo Simulation

Overview

Backtesting applies a trading strategy to historical data to evaluate how it would have performed, while Monte Carlo simulation randomises the order of those historical trades across thousands of iterations to understand the range of possible outcomes. Together, these techniques provide both an estimate of expected performance and a probabilistic view of risk, drawdown, and return distributions.

Key Concepts

Backtesting replays a strategy against historical price data to generate a performance track record. Walk-forward analysis splits data into in-sample (optimise) and out-of-sample (validate) periods. Overfitting occurs when a strategy is tuned to historical noise rather than genuine patterns. Monte Carlo simulation shuffles trade outcomes to model the probability distribution of returns and drawdowns. Maximum drawdown, Sharpe ratio, and profit factor are key backtest performance metrics. Survivorship bias, look-ahead bias, and data-snooping bias are common backtesting pitfalls.

Entry Signals

Only trade strategies that produce statistically significant results across multiple out-of-sample test periods. Require a minimum sample size of at least one hundred trades in the backtest before considering a strategy viable. Ensure the strategy remains profitable across different market regimes — trending, ranging, and volatile. Use Monte Carlo simulation to verify that the strategy survives the worst-case sequence of trades.

Exit Signals

Halt live trading if actual performance falls below the fifth percentile of Monte Carlo simulated outcomes. Retire a strategy if the rolling Sharpe ratio drops below the acceptable threshold for more than three months. Reduce allocation when real-time drawdown exceeds the seventy-fifth percentile of simulated maximum drawdowns. Re-evaluate if market microstructure changes undermine the strategy's assumptions.

Best Timeframes

Strategy-dependent — analysis applies to all timeframes

Pro Tips

The most common backtesting mistake is overfitting — a strategy that works perfectly on historical data but fails live. Combat this by using walk-forward validation, keeping the number of parameters minimal, and testing on data the strategy has never seen. Monte Carlo simulation reveals that even good strategies can experience severe drawdowns through unlucky trade ordering.