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.
More Topics in This Category
Algorithmic Trading Strategies
Algorithmic trading uses computer programs to execute trades based on predefined rules — from simple moving average crossovers to complex machine learning models. The key advantage is removing emotion, achieving consistent execution speed, and backtesting strategies across decades of data before risking real capital.
Statistical Arbitrage
Statistical arbitrage (stat arb) exploits temporary mispricings between correlated assets using quantitative models. Pairs trading — the simplest form — goes long the underperformer and short the outperformer when their price ratio deviates beyond historical norms, profiting as the spread reverts to the mean.
Grid Trading
Grid trading places buy and sell limit orders at regular price intervals above and below the current market price, creating a 'grid' that profits from range-bound oscillations. Each buy order has a corresponding sell order at a higher grid level, generating profit from each completed round trip. It works best in sideways markets and can be automated easily.
Trend-Following Systems
Trend-following systems identify and ride sustained directional moves using rules-based approaches — moving average crossovers, breakout channels (Donchian, Keltner), and momentum filters. The strategy accepts many small losses for occasional outsized winners, relying on fat-tailed distribution of returns in financial markets.