Monte Carlo Simulation for Traders
Your backtest shows a maximum drawdown of 12%. But what if the worst losing trades had clustered together instead of being spread out? Monte Carlo simulation answers that question — before you trade real money.
The problem with a single backtest path
A standard backtest produces one equity curve — the specific sequence of wins and losses that happened in your historical dataset. But the order of those trades is largely random. Your 10 worst trades could have occurred back-to-back instead of spread across 5 years. If they had, your drawdown would look very different.
A single equity curve does not show you the range of outcomes your strategy could realistically produce. Monte Carlo simulation does.
How Monte Carlo works in backtesting
- 1Take the list of all trades from your backtest (each with its P&L).
- 2Randomly shuffle the order of those trades.
- 3Compute the equity curve for that shuffled sequence.
- 4Repeat 1,000 times (or more).
- 5Analyze the distribution of outcomes across all simulations.
The result is not a single equity curve but a probability distribution: a band showing the range of plausible results under different trade orderings.
Key outputs and how to read them
95th-percentile maximum drawdown
In 95% of simulated sequences, the drawdown was at most this value. This is your risk planning number. If the 95th-percentile drawdown is 35% but you can only tolerate 20%, you need to reduce position size — regardless of how good the base backtest looks.
Worst-case consecutive losing streak
How many losses in a row could you expect in the worst 5% of sequences? This number is critical for psychological preparation and for not abandoning a strategy during a normal losing run.
Probability of ruin
The percentage of simulations where the account dropped below a defined threshold (e.g., 50% loss). A strategy with a 5% probability of ruin is very different from one with 0.1% — even if the average returns look similar.
Return distribution (5th / 50th / 95th percentile)
These three numbers tell you the range of final account values you could expect. A wide gap between the 5th and 95th percentile means the strategy has high variance — the outcome depends heavily on luck of sequencing.
Using Monte Carlo for position sizing
Monte Carlo is not just a diagnostic tool — it is a position sizing tool. The process is:
- 1. Run Monte Carlo on your strategy at your current position size.
- 2. Find the 95th-percentile max drawdown.
- 3. If that drawdown exceeds what you can tolerate (financially or psychologically), scale down position size proportionally.
- 4. Re-run Monte Carlo to confirm the new drawdown distribution is acceptable.
A strategy with a 95th-percentile drawdown of 40% run at 50% position size becomes a strategy with a 20% drawdown — same edge, lower risk.
What Monte Carlo does not test
Monte Carlo reshuffles your historical trades but does not generate new ones. It assumes the future will look similar in terms of trade distribution to the past. It does not account for regime changes (e.g., a strategy that works in trending markets failing in choppy ones), nor does it replace walk-forward optimization for detecting overfitting. Use both.
Run Monte Carlo on your strategy
BacktestLM runs 1,000+ Monte Carlo simulations automatically after every backtest. No coding required.
Start backtesting free