Monte Carlo Simulation for Trading Strategies: Why One Backtest Is Not Enough
# Monte Carlo Simulation for Trading Strategies: Why One Backtest Is Not Enough
A single backtest produces a single equity curve based on the specific historical sequence of trades. But what if those trades had occurred in a different order? What if you had started trading at a different point in time? Monte Carlo simulation answers these questions by revealing the distribution of possible outcomes rather than a single misleading path.
What Is Monte Carlo Simulation?
In the context of trading, Monte Carlo simulation involves randomly resampling your backtest trades (with replacement) thousands of times to generate thousands of possible equity curves. Each simulation represents a plausible sequence of wins and losses that your strategy could produce. By analyzing the distribution of outcomes, you gain insight into the range of drawdowns, returns, and risk metrics you might actually experience.
Why Trade Sequence Matters
Consider a strategy with 100 trades that produces a net profit. If the first 20 trades are all losers followed by 80 winners, you would experience a devastating early drawdown that might cause you to abandon the strategy before the winners arrive. If the same trades occurred in random order, the experience would be completely different. Monte Carlo simulation shows you the probability of encountering various drawdown depths depending on when you start.
Running a Monte Carlo Analysis
The basic procedure is straightforward. First, extract all individual trade results from your backtest. Second, randomly resample these trades (drawing with replacement) to create a new synthetic sequence of the same length. Third, calculate the equity curve, maximum drawdown, and final return for this new sequence. Fourth, repeat this process 10,000 times. Finally, analyze the distribution of results across all simulations.
Interpreting the Results
After running 10,000 simulations, you can construct confidence intervals. For example, you might find that at the 95th percentile, your maximum drawdown could reach 35%, even though your historical backtest only showed a 20% drawdown. This tells you there is a 5% chance of experiencing a drawdown 75% worse than what you saw historically. This information is critical for position sizing and risk management decisions.
A Practical Example
We took a momentum strategy with 250 backtested trades, a 55% win rate, and a 1.5 reward-to-risk ratio. The historical backtest showed a maximum drawdown of 18% and an annualized return of 14%. After Monte Carlo simulation, the 95th percentile drawdown was 29%, and the 5th percentile annualized return was only 6%. This wide range of outcomes from the same underlying trade statistics demonstrates why you should never plan around the single historical result.
Position Sizing with Monte Carlo
One of the most powerful applications is determining appropriate position sizing. If your Monte Carlo simulation shows that at your current position size, there is a 10% chance of a 50% drawdown, you might decide that risk is unacceptable. By reducing position size and rerunning the simulation, you can find the sizing that keeps your worst-case drawdown within your psychological and financial tolerance.
Limitations and Assumptions
Monte Carlo simulation assumes that trades are independent and identically distributed. In reality, trading returns often exhibit serial correlation (winning streaks and losing streaks tend to cluster), and market regime changes can alter the underlying win rate and reward-to-risk ratio. More sophisticated approaches use block bootstrapping to preserve serial correlation or regime-switching models to account for changing market conditions.
Tools for Monte Carlo Simulation
Several platforms offer built-in Monte Carlo analysis. QuantConnect, Amibroker, and TradeStation all include this functionality. For custom analysis, Python with NumPy makes implementation straightforward in just a few dozen lines of code. The key is generating enough simulations (at least 5,000) to produce stable statistical estimates and visualizing the results effectively through confidence bands around the equity curve.
Integrating Monte Carlo into Your Workflow
We recommend running Monte Carlo simulation as a standard part of every strategy evaluation. After completing your backtest, immediately run the Monte Carlo analysis before making any decisions about live trading. Use the 95th percentile drawdown as your planning basis, not the historical drawdown. Set your position size so that the 95th percentile drawdown remains within your risk tolerance. This approach prepares you for realistic adverse scenarios rather than the optimistic single historical path.
Conclusion
A single backtest equity curve is just one possible path through the universe of outcomes your strategy could produce. Monte Carlo simulation reveals the full distribution, helping you understand the true risk you are accepting. By planning for the 95th percentile outcomes rather than the median, you build a trading business that can survive the inevitable rough patches and continue compounding over the long term.