Monte Carlo Simulation for Trading Strategies
Monte Carlo simulation for trading strategies randomly reshuffles the sequence of historical trade returns thousands of times. Each permutation produces a different equity curve. The distribution of those curves reveals the realistic range of outcomes your strategy could produce — and, critically, the worst-case drawdowns you need to plan for before risking real capital.
Definition
Monte Carlo simulation — repeated random sampling applied to a strategy's trade history to generate a distribution of possible equity curves. Where a backtest gives you one path through history, Monte Carlo gives you thousands — showing the full range of outcomes the same edge could have produced.
Why does trade order matter?
A backtest is one path through history. The same set of trades — the same wins and losses — produces radically different equity curves depending on their order. A strategy that opens with a long losing streak can destroy the account before the winning period recovers it. A strategy that opens with the same wins first looks excellent throughout.
The order your backtest happened to take is not special. It is one realisation of a random process. Monte Carlo makes this explicit: by generating thousands of orderings, you see the full probability distribution of what "running this strategy" actually means.
How to run a Monte Carlo simulation on a backtest
- Collect your trade returns. From your backtest, extract the percentage return (or R-multiple) of every completed trade. This is your trade sample.
- Shuffle and replay. Randomly reorder the trade returns and compute the resulting equity curve. Record the final return, maximum drawdown, and Sharpe ratio for that permutation.
- Repeat 1,000–10,000 times. Each iteration produces one equity curve. With 5,000 runs you have a stable distribution.
- Compute percentile statistics. Sort the 5,000 drawdown values and read off the 5th, 25th, 50th, and 95th percentiles. These are your confidence bands.
- Apply a position-sizing decision. If the 5th-percentile drawdown exceeds your tolerance, reduce fractional position size until it does not.
What do the percentile results mean?
| Percentile | What it represents | How to use it |
|---|---|---|
| 5th | Worse than 95% of simulated paths — near worst case | Set as your maximum tolerable drawdown limit |
| 25th | A bad-but-not-catastrophic run | Plan for this as a realistic drawdown scenario |
| 50th | Median outcome — the "average" path | Closer to expected live performance than the backtest peak |
| 95th | An unusually good run — better than 95% of paths | Do not plan around this — it is the lucky scenario |
The key number is the 5th-percentile maximum drawdown. If it is 35% and you can only tolerate 20%, halve your position size. The drawdown scales linearly with position size; the expected return scales at the same rate — so this is a clean lever.
Two approaches: trade shuffling vs synthetic returns
There are two common Monte Carlo methods for trading, each with different assumptions:
| Method | How it works | Best for |
|---|---|---|
| Trade shuffling | Reorders the actual historical trade returns randomly | Preserving the real return distribution; quick to implement |
| Synthetic returns | Samples from a fitted distribution (normal, Student-t) | Modelling fat tails and scenarios not in the trade sample |
Trade shuffling is simpler and requires no distributional assumptions. Synthetic returns can model tail risks not present in your specific sample — useful for strategies with few trades where the sample may not capture the full distribution. For most strategies, trade shuffling is the right starting point.
What Monte Carlo simulation does not tell you
Monte Carlo simulation measures outcome variance given your trade list. It does not tell you whether that trade list was produced by a real edge or by overfitting. A beautifully distributed Monte Carlo on an overfit strategy is still worthless.
Use walk-forward analysis and out-of-sample testing to validate the edge first. Apply Monte Carlo to quantify drawdown risk once you have confidence the edge is real. The two methods answer complementary questions — they are not alternatives.
Test your strategy's worst-case drawdown before going live
backtester.run runs a full zipline backtest from a plain-English strategy description and includes Monte Carlo percentile bands so you can size positions to your actual risk tolerance.
Start free →Frequently Asked Questions
- What is Monte Carlo simulation in trading?
- Monte Carlo simulation for trading strategies randomly reshuffles the sequence of historical trade returns thousands of times. Each permutation produces a different equity curve. The distribution of those curves reveals the realistic range of outcomes — not just the single path that history happened to take.
- What does the 5th-percentile Monte Carlo result mean?
- The 5th-percentile equity curve is the outcome that was worse than 95% of all simulated paths. It represents a conservative estimate of your strategy's worst expected drawdown under normal conditions. If that drawdown exceeds your risk tolerance, reduce position size before going live.
- How many simulations should you run for Monte Carlo analysis?
- Run at least 1,000 simulations for a stable distribution. 5,000–10,000 is better for smooth percentile bands. More than 10,000 simulations rarely adds meaningful information beyond what 5,000 already shows.
- What is the difference between Monte Carlo simulation and walk-forward analysis?
- Walk-forward analysis tests whether strategy parameters generalise across different time periods. Monte Carlo simulation tests the range of outcomes given the fixed trade sequence from your backtest. They answer different questions: WFA tests robustness across time; Monte Carlo tests the distribution of luck within a fixed result.
- Can Monte Carlo simulation detect overfitting?
- Not directly. Monte Carlo tells you about outcome variance given your trade list — it does not tell you whether that trade list was produced by a genuine edge or by overfitting. Use walk-forward analysis and in-sample/out-of-sample testing to detect overfitting; use Monte Carlo to quantify drawdown risk once you have a validated strategy.
- What is randomised-returns Monte Carlo vs trade-sequence shuffling?
- Trade-sequence shuffling reorders the actual historical trades in random order. Randomised-returns Monte Carlo samples returns from a fitted distribution (e.g. normal or Student-t) and generates synthetic equity curves. Shuffling preserves the real trade return distribution; synthetic sampling can model fat tails and skew not present in your specific trade sample.