Monte Carlo Simulation for Trading Strategies: Stress-Testing Your Edge Before You Risk Capital
Overview #
You ran your backtest. The equity curve slopes upward. The profit factor is 1.8. You're ready to go live.
But here's the question nobody asks: what if those same trades happened in a different order? What if your three biggest winners clustered at the end instead of saving you from an early drawdown? What if that drawdown hit first and wiped your account before the winners arrived?
That's the question Monte Carlo simulation answers. It takes your backtest results, scrambles the trade order thousands of times, and shows you the full range of equity paths your strategy could have produced
What Monte Carlo Simulation Does #
The core mechanic is simple. Take your backtest's list of trades. Randomly reorder them. Build a new equity curve from that reordered sequence. Repeat thousands of times.
As @kevinkdog explains, "You run a backtest, and you get a sequence of trades, and from that you build an equity curve. From that equity curve, you know your return, your max drawdown, etc. But, what if you had the same trades, but just in a different order? That is what Monte Carlo simulation does. It takes your trades, and scrambles them up, giving you many different equity curves." [1]
The theory behind this: going forward, the exact sequence of winning and losing trades is unknowable. Any permutation of your historical trades is a plausible future scenario. By generating thousands of these permutations, you build a probability distribution of outcomes
Most implementations (including NinjaTrader's built-in tool) use bootstrapping
Run 1,000 or 2,500 simulations and you get a statistically meaningful picture of what your strategy's future performance distribution looks like
Reading the Output #
Monte Carlo output is a Cumulative Distribution Function (CDF)
The key percentiles that matter:
5th percentile
25th percentile
50th percentile (median)
75th-95th percentile
The drawdown CDF is equally important. @serac uses it as a kill switch: "If I was fairly confident on the accuracy of my backtest, and experienced a drawdown way to the left of this curve, I would consider halting the strategy." [3] In practice, if your live drawdown exceeds the 5th percentile drawdown from Monte Carlo, your strategy has likely broken
Five Practical Applications #
1. Curve Fitting Detection #
This is Monte Carlo's most powerful use. A curve-fitted strategy relies on a few large winning trades that happened at specific moments in history. When you scramble the trade order, those key trades get distributed differently
A strong strategy shows a tight CDF
2. Capital Requirements #
How much starting capital do you actually need? Your backtest might show a $5,000 drawdown, but that's ONE possible sequence. Monte Carlo shows you the distribution of possible drawdowns.
Use the 5th percentile maximum drawdown as your planning number. Multiply by 1.5x for a safety margin (live trading always produces worse drawdowns than simulated). That's your minimum account size. If you can't fund that amount, you can't trade that strategy
3. Risk of Ruin Estimation #
@Fat Tails demonstrates this application: select k trades from your sample, repeat N times, and read the probability of reaching a target or hitting ruin directly from the CDF chart. [4] This replaces simplified risk-of-ruin formulas (which assume Bernoulli distributions with fixed win/loss sizes) with a more realistic estimate that uses your actual trade distribution
4. Position Sizing Evaluation #
Monte Carlo lets you compare position sizing approaches head-to-head. @kevinkdog demonstrates this by comparing a fixed 1-contract approach against a modified martingale using 2,500 Monte Carlo simulations: the martingale approach showed higher median final equity ($180 vs $150) but much larger drawdowns. [5] The CDF makes the tradeoff explicit
5. Robustness Margin Testing #
This is the most underappreciated Monte Carlo technique. Remove your best trades before running the simulation and see what happens.
[3] That 35% is your robustness margin. A strategy where removing the top 5% of trades kills profitability is fragile
When Monte Carlo Fails #
Monte Carlo simulation has a critical assumption that limits its applicability: trade independence.
The math only works when each trade's outcome is independent of the trade before it. @Fat Tails flags the key exception: "If your trades are positively or negatively correlated
Strategies where Monte Carlo is unreliable:
- Pyramiding / scaling in: Each add depends on the prior entry being profitable. Scrambling the trades destroys the dependency structure.
- Mean reversion grids: Entries at multiple levels depend on price reaching each level sequentially. Reordering breaks the logic.
- Strategies with strong serial correlation: If winning trades cluster (momentum following) or alternate (mean reversion with fixed intervals), the order matters and shouldn't be randomized.
- Portfolio strategies: When multiple instruments hedge each other, randomizing individual trades breaks the correlation structure that produces the hedged return.
Beyond trade independence, Monte Carlo also can't model:
Regime changes: It assumes the distribution of trade outcomes is stable. A strategy that worked in low-vol 2019 and broke in high-vol 2020 will show a mixed distribution
Market impact: The simulation uses your historical fills. In reality, scaling up position size degrades fills. A strategy that works at 1 contract might fail at 10
Correlation with market conditions: Trade outcomes aren't truly random. They cluster around market events, economic releases, and volatility regimes. Monte Carlo treats them as independent draws from a static urn.
Running a Monte Carlo Analysis #
Step-by-Step Process #
- Get your trade list: Export all trades from your backtest
- Choose your simulation count: 1,000 simulations is the minimum for reasonable statistics. 2,500 gives smoother CDFs. More than 10,000 adds computation time without meaningful precision gain.
- Run the base simulation: Resample all trades with replacement, build equity curves. Record final equity, max drawdown, longest losing streak, and profit factor for each simulation.
- Run the robustness test: Remove the top 5% of trades by P&L. Re-run the full Monte Carlo. Then remove 10%. Then 15%. Find your break-even point
- Read the CDFs: Check the 5th percentile for worst-case planning, 50th for expected outcome, drawdown CDF for position sizing.
- Set kill-switch thresholds: If live drawdown exceeds the 5th percentile Monte Carlo drawdown, halt the strategy. If live win rate drops below the 10th percentile simulated win rate over 50+ trades, re-evaluate.
Minimum Viability Thresholds #
A strategy worth deploying capital to should meet ALL of these Monte Carlo criteria:
- 5th percentile cumulative profit is positive (95% chance of making money)
- Median max drawdown is survivable at your planned position size
- Strategy remains profitable after removing top 10% of trades
- Win rate at 25th percentile still exceeds breakeven (accounting for average win/loss ratio)
Fail any one of these and you either have insufficient edge or insufficient robustness.
Further Reading #
Prerequisites
Further Exploration:
Knowledge Map
Prerequisites
Understand these firstGo Deeper
Build on this knowledgeReferences This Article
Articles that build on this topicCitations
- — KJ Trading Systems Kevin Davey - Ask Me Anything (AMA) (2017) 👍 2“That is what Monte Carlo simulation does. It takes your trades, and scrambles them up, giving you many different equity curves.”
- — Ninja Trader Monte Carlo (2011) 👍 7“If your strategy is curve-fitted, it is likely that it will not pass the Monte-Carlo-Simulation very well.”
- — Walk Forward Experiment (2012) 👍 10“The 50% mark on the x-axis is the mean cumulative profit.”
- — Risk of Ruin (2012) 👍 7“A better approach to determine the probability of reaching a fraction/multiple of your initial bankroll is a Monte Carlo Analysis.”
- — Position sizing strategy for scalping (2023) 👍 3“Running some Monte Carlo (random number) simulations.”
- — Tip for backtesting on Renko charts (2014) 👍 7“You MUST do Monte Carlo simulations. This is the most under utilized tool.”
