Monte Carlo Simulation for Traders

Stress-Test Your Strategy Against Random Outcomes

Monte Carlo simulation stress-tests your trading strategy by resampling trades thousands of times to reveal the true range of possible drawdowns, returns, and ruin risk.

18 minAdvanced

The Problem Monte Carlo Solves

A backtest produces one equity curve. One sequence of trades translated into one drawdown, one final return, and one set of statistics. You know what happened. You do not know what could have happened.

The equity curve you see is the product of a specific ordering of trades. Your strategy entered and exited the market in a particular sequence dictated by history. But that sequence is only one of countless possible orderings. A different roll of the dice — the same trades arriving in a different order — could have produced a deeper drawdown, a smoother ride, or a very different final balance.

Monte Carlo simulation answers the question: given this set of trade outcomes, what is the realistic range of results I should prepare for? It takes the trades from your backtest and resamples them thousands of times, generating thousands of alternative equity curves. The distribution of those curves reveals the true risk profile of your strategy — not the single data point your backtest happened to produce.

This is not a theoretical exercise. The 95th percentile drawdown from Monte Carlo is a far better basis for position sizing than your backtest drawdown. The profit probability across simulations is a more honest assessment of your edge than a single final return. Monte Carlo transforms one observation into a distribution, and distributions are what you actually need for risk management.

Why Trade Order Matters

Consider a strategy that produced 100 trades: 60 winners averaging +2% and 40 losers averaging -3%. The same set of trades. The same edge. But the experience of trading them depends entirely on the order they arrive.

Scenario A: Losers first

Imagine the first 20 trades are all losers. Your account drops roughly 45% before the winners start arriving. Even though the strategy eventually recovers and finishes profitable, you experienced a drawdown that would have been psychologically devastating — and might have triggered a margin call or caused you to abandon the strategy.

Scenario B: Winners first

Now imagine the first 30 trades are mostly winners. Your account grows steadily, and when the losing streak finally arrives, it feels like a normal pullback rather than a crisis. The final return is similar, but the journey is completely different.

The key insight

Your backtest experienced one specific ordering. That ordering might have been lucky (shallow drawdown) or unlucky (deep drawdown). You have no way of knowing which without testing other orderings. Monte Carlo does exactly this — it reveals the full range of paths your account could have taken, given the same underlying trade results.

This is why traders who size their positions based on backtest drawdown alone are making a mistake. The backtest drawdown is one sample from a distribution. Monte Carlo shows you the distribution.

Same Trades, Different Order

Losers first
Backtest order
Winners first
All three paths use the same trades and end at the same value. Only the order differs.

How Bootstrap Resampling Works

Monte Carlo simulation in trading uses a technique called bootstrap resampling. The process is straightforward.

Step 1: Extract the trade data

Each trade from your backtest is converted into a portfolio-relative return — the percentage impact that trade had on your account. A trade that made $200 on a $10,000 portfolio is a +2% return. This normalisation is important because it captures the actual impact of each trade, with position sizing already baked in.

Step 2: Resample with replacement

The simulation randomly draws N trades from your original set, where N is the number of trades in your backtest. Crucially, this is done with replacement — the same trade can be drawn multiple times, and some trades may be skipped entirely. Each draw creates a new synthetic trade sequence.

Step 3: Build the equity curve

Starting from your initial portfolio value, the simulation applies each resampled trade sequentially. After each trade, the cumulative return updates and the portfolio value adjusts. If the portfolio reaches zero, the simulation stops — the strategy has been ruined.

Step 4: Record the outcome

Each simulation records the final return, the maximum drawdown experienced along the way, the win rate of the resampled trades, and the full equity curve. After thousands of simulations, these individual results form distributions that reveal the realistic range of outcomes.

Why additive, not compounded?

The returns are summed additively rather than compounded. This means the distribution of final returns converges to a normal (bell-curve) shape via the Central Limit Theorem. Compounding would produce a log-normal distribution with heavy right skew, which makes percentile calculations less intuitive. The additive approach gives you cleaner statistics and more conservative risk estimates.

The Equity Curve Fan Chart

The equity curve fan chart is the most visually intuitive output of a Monte Carlo simulation. It shows the range of possible equity paths your account could take, given the same set of trades.

Reading the bands

The chart overlays five percentile curves from the simulation results:

  • P5 (5th percentile) — The near-worst-case path. Only 5% of simulations did worse than this.
  • P25 (25th percentile) — The pessimistic path. A quarter of simulations fell below this.
  • P50 (50th percentile / median) — The typical path. Half the simulations were above, half below.
  • P75 (75th percentile) — The optimistic path. Only a quarter of simulations did better.
  • P95 (95th percentile) — The near-best-case path. Only 5% of simulations did better.

The area between P5 and P95 represents the 90% probability zone — the range within which 90% of all simulations fell. The narrower this band, the more predictable and stable the strategy.

What to look for

Band width. Wide bands mean high uncertainty. The strategy's outcome depends heavily on which trades happen to arrive when. Narrow bands mean the result is relatively stable regardless of trade ordering — a strong sign of robustness.

P5 trajectory. Does the 5th percentile path stay positive, or does it dip below the starting balance? If P5 goes negative, there is a meaningful chance (roughly 1 in 20) of losing money even though the strategy is profitable on average.

Convergence. Do the bands converge as the number of trades increases? Strategies with a genuine edge tend to show convergence — the longer you trade, the more predictable the outcome. If the bands keep widening, the variance may overwhelm the edge over time.

Equity Curve Fan — Confidence Bands
P5 / P95
P25 / P75
P50 (Median)
The fan widens with more trades — wider bands mean higher outcome uncertainty.

The Return Distribution

The return distribution chart is a histogram showing the frequency of final returns across all simulations. Each bar represents a range of returns — how many simulations ended in that bucket.

Shape of the distribution

With additive returns and enough simulations, the distribution approximates a bell curve centred on the mean return. The shape tells you several things:

  • Centre — Where the peak sits is the most likely outcome. If the centre is well to the right of zero, the strategy has a clear positive expectation.
  • Width — A wide distribution means high variance. The same strategy could produce very different returns depending on trade ordering. A narrow distribution means outcomes are tightly clustered.
  • Left tail — How far the distribution extends into negative territory reveals the downside risk. A fat left tail means there is a non-trivial probability of significant losses.

Your backtest vs. the distribution

The original backtest return is typically marked on the distribution for reference. If your backtest return sits near the right edge, you got lucky — the actual experience was better than most simulations. If it sits near the centre, the backtest was typical. If it sits to the left, the backtest was unluckier than average, and you can expect better results from the same trades under different ordering.

The position of the backtest return relative to the distribution is a quick sanity check on how representative your single backtest was. Most traders find their backtest result is roughly in the middle — which is reassuring. An extreme position in either direction warrants further investigation.

Return Distribution — 1,000 Simulations

Mean: +15.2%Median: +14.8%Std Dev: 12.3%
The backtest return (+22%) sits right of centre — luckier than the median simulation.

The Drawdown Distribution

While the return distribution shows final outcomes, the drawdown distribution shows the worst thing that happened along the way. This is arguably the more important chart for risk management.

How it works

For each simulation, the maximum peak-to-trough drawdown is recorded — the largest decline from any high point to any subsequent low point during that simulation's equity curve. These maximum drawdowns are collected across all simulations and plotted as a histogram.

Key percentiles

  • Average max drawdown — The mean of all simulations' worst drawdowns. This is the drawdown you should expect on a "typical" run of the strategy.
  • Worst drawdown (P95) — The 95th percentile. Only 5% of simulations experienced a drawdown worse than this. This is your planning number for risk management.
  • Absolute worst — The single worst drawdown across all simulations. Rare but possible. If this number is -80% or worse, the strategy has tail risk even if the average case looks manageable.

The sizing implication

If your backtest showed a maximum drawdown of -18% but the Monte Carlo P95 drawdown is -35%, you need to size for -35%. The -18% was the result of one lucky ordering. Under different luck, the drawdown could have been nearly twice as deep. This single insight — that realistic worst-case drawdown is typically much larger than backtest drawdown — is one of the most practical outputs of Monte Carlo simulation.

Drawdown Distribution — Max Drawdowns

Avg DD: -22.4%P95 DD: -42%Backtest DD: -18%
The backtest drawdown (-18%) was luckier than average. Size for the P95 scenario (-42%).

Key Statistics Explained

Monte Carlo produces a set of summary statistics that distil the distribution into actionable numbers. Understanding each one is important for making good risk decisions.

Expected return (mean)

The average final return across all simulations. This is your strategy's long-run expectation, unbiased by the specific trade ordering of your backtest. If the mean is positive and significantly different from zero, the strategy has a statistical edge.

Standard deviation

The spread of returns around the mean. High standard deviation means the strategy's outcome is sensitive to trade ordering — you might do very well or very poorly depending on luck. Low standard deviation means outcomes cluster tightly around the expected return.

Value at Risk (VaR)

The return at the lower confidence bound. At 95% confidence, VaR is the 5th percentile return — the worst return that 95% of simulations beat. If the VaR is -12%, you can expect to lose no more than 12% in 95 out of 100 scenarios.

Probability of profit

The percentage of simulations that ended with a positive return. A strategy with 85% probability of profit has an edge that survives most resamplings. A strategy with 55% probability of profit might be marginally profitable but sensitive to conditions. Below 50% and the strategy is more likely to lose money than make it.

Average and worst drawdown

The mean max drawdown tells you what to expect on a typical run. The worst drawdown (95th percentile) tells you what to prepare for. The gap between these two numbers reveals how much your downside risk varies — a large gap means the strategy occasionally experiences drawdowns far worse than normal.

Confidence interval

The range bounded by the lower and upper confidence limits at your chosen level. A 95% confidence interval of [+5%, +42%] means that 95% of simulations finished between those two returns. The width of this interval is a practical measure of outcome uncertainty.

Monte Carlo Statistics — 1,000 Simulations
Expected Return
+15.2%
(mean)
Std Deviation
12.3%
Value at Risk (95%)
-8.5%
5th percentile
Probability of Profit
87.3%
873 / 1,000 sims
Avg Max Drawdown
-22.4%
mean of max DDs
Worst Drawdown (P95)
-42.0%
95th percentile
95% Confidence Interval
+2.1%
+28.3%
87% of simulations were profitable. The 95% confidence interval spans +2.1% to +28.3%.

Confidence Levels and Value at Risk

The confidence level determines how conservative your risk assessment is. Higher confidence means you are planning for rarer, worse outcomes.

Available confidence levels

  • 90% — Plans for 1-in-10 bad outcomes. The least conservative setting. Useful for initial screening, but leaves meaningful tail risk unaccounted for.
  • 95% — Plans for 1-in-20 bad outcomes. The standard default and the most commonly used level in risk management. Balances conservatism against practical usability.
  • 99% — Plans for 1-in-100 bad outcomes. Conservative. Useful for traders managing larger capital or with low risk tolerance.
  • 99.9% — Plans for 1-in-1,000 bad outcomes. Highly conservative. The drawdown and VaR figures at this level will be significantly worse than at 95%, but they represent events that are genuinely rare.

Choosing the right level

There is no universally correct choice. The trade-off is straightforward: higher confidence gives wider margins of safety but also requires smaller position sizes, which reduces returns. Lower confidence allows larger positions but leaves you exposed to tail events.

For most traders, 95% is the sensible default. It provides a realistic worst case without being so extreme that position sizes become impractically small. If you are managing capital you cannot afford to lose, 99% is reasonable. Reserve 99.9% for institutional-grade risk analysis or when the consequences of a large loss are asymmetric (margin calls, fund liquidation).

How VaR changes with confidence

As you increase the confidence level, the VaR gets worse (more negative). This is expected — you are looking deeper into the left tail of the distribution. If VaR at 95% is -15% and at 99% is -28%, the strategy has meaningful tail risk beyond the standard confidence level. A large jump between 95% and 99% VaR indicates a fat left tail — rare events are disproportionately bad.

Confidence Levels — VaR and Drawdown
Higher confidence = planning for rarer, worse outcomes
LevelVaRWorst-Case DrawdownProfile
90%-5.2%
-32%
Standard
95%-8.5%
-42%
Default
99%-16.8%
-55%
Conservative
99.9%-24.1%
-68%
Extreme
Same strategy, same trades — only the tail depth changes
At 99.9% confidence, plan for a -68% drawdown vs -42% at the standard 95% level.

Position Sizing from Monte Carlo

Monte Carlo's most practical application is informing position sizes. The logic is simple: size your positions so the realistic worst-case drawdown is within your tolerance.

The single-backtest trap

Without Monte Carlo, traders size positions based on backtest drawdown. If the backtest showed a -20% max drawdown and their tolerance is -30%, they might use full position sizes. But the backtest drawdown was one observation from a distribution. The 95th percentile drawdown might be -38%, which blows through the tolerance.

The Monte Carlo approach

Take the P95 drawdown from Monte Carlo as your planning number. If P95 drawdown is -38% and your maximum tolerance is -25%, you need to scale position sizes down by a factor of 25/38 = 0.66. That means using roughly two-thirds of the position sizes your backtest used.

This is conservative, and that is the point. You are sizing for an outcome that only happens 5% of the time. In the other 95% of scenarios, your actual drawdown will be less severe, and you will wish you had sized larger. But the 5% scenario is the one that can destroy your account — and surviving it is worth the cost of slightly reduced returns in the normal case.

Position sizing formula

The scaling factor is:

Scale = Tolerance / P95 Drawdown

If Scale is above 1.0, your backtest position sizes are already within tolerance — no reduction needed. If Scale is below 1.0, multiply all position sizes by this factor. The result is a position sizing regime that has a 95% chance of staying within your drawdown tolerance.

Position Sizing from Monte Carlo
Maximum drawdown tolerance: -25%
Backtest-based sizingUses single backtest DD
-18%
Scale = 25% / 18% = 1.00Full size
MC P95-based sizingUses 95th percentile DD
-42%
Scale = 25% / 42% = 0.6060% size
MC reveals the backtest sizing is too aggressive. Scale to 60% to stay within tolerance.

Ruin Risk and Survival

Ruin risk is the probability that your account suffers an unrecoverable loss. In Monte Carlo terms, it is the percentage of simulations where the portfolio dropped below a threshold from which recovery is practically impossible.

Defining ruin

What counts as "ruin" varies by trader. Common thresholds:

  • -50% drawdown — Mathematically, you need a +100% return to recover. Possible but extremely difficult.
  • -75% drawdown — Requires a +300% return to recover. Practically unrecoverable for most strategies.
  • Portfolio reaches zero — The position sizing or leverage caused a total loss.

Reading ruin risk from Monte Carlo

Count the number of simulations where the maximum drawdown exceeded your ruin threshold. If 1,000 out of 10,000 simulations hit -50% or worse, your ruin probability is 10%. That is far too high for any serious trading approach.

Acceptable ruin risk depends on context, but most risk management frameworks target below 1% — meaning fewer than 1 in 100 simulations should reach the ruin threshold. If your strategy shows ruin risk above 5%, the position sizes are too large, the strategy has too much variance, or both.

The compounding problem

Ruin risk compounds over time. If there is a 2% probability of ruin per year, the probability of surviving 10 years is roughly 0.9810 = 82%. That means an 18% chance of ruin over a decade — far less comfortable than the 2% annual figure suggests. Monte Carlo reveals this by showing you the distribution of worst drawdowns, making the long-term risk tangible.

Comparing Strategies with Monte Carlo

Monte Carlo becomes especially powerful when comparing two or more strategies. Raw backtest returns and Sharpe ratios can be misleading — a strategy with a higher return might also have a much wider distribution of outcomes.

What to compare

  • Distribution width — A strategy with a narrower Monte Carlo distribution is more predictable. If Strategy A has a 95% confidence interval of [+8%, +35%] and Strategy B has [+2%, +50%], Strategy A delivers more consistent results even though Strategy B has higher upside potential.
  • P95 drawdown — The realistic worst case. Strategy A might have a P95 drawdown of -22% while Strategy B has -40%. Strategy A is safer, full stop, regardless of which has a higher mean return.
  • Probability of profit — Strategy A at 92% vs. Strategy B at 68%. Strategy A nearly always makes money when trades are resampled. Strategy B is profitable more often than not, but over a third of resamplings result in a loss.
  • VaR — At the same confidence level, which strategy has a better (less negative) Value at Risk? This is a direct comparison of downside risk.

The narrower-band principle

When two strategies have similar expected returns, prefer the one with tighter Monte Carlo bands. Tighter bands mean the result is less dependent on luck and more dependent on the edge. In practice, this often means preferring a strategy with moderate returns and low variance over a strategy with high returns and high variance. The stable strategy is easier to size, easier to stick with during drawdowns, and more likely to deliver results close to what Monte Carlo predicts.

Strategy Comparison — Monte Carlo
Strategy A
EMA Cross
Strategy B
Momentum Breakout
Mean Return
+14.8%
+18.5%
95% CI
[+8%, +22%]
[+2%, +38%]
P95 Drawdown
-22%
-41%
Profit Prob.
92%
68%
VaR (95%)
-5.2%
-12.8%
Confidence interval width (narrower = more predictable)
Strategy A
14%
Strategy B
36%
Strategy A has lower returns but tighter bands — more predictable and easier to size.

Monte Carlo in Quanthop

Quanthop runs Monte Carlo simulation directly on your backtest results. No export, no external tools, no setup. The simulation executes in your browser after any completed backtest.

Configuration

Two settings control the simulation:

  • Number of simulations — Choose from 100 to 10,000. Higher counts produce more stable percentile estimates but take longer. The default of 1,000 provides good statistical coverage for most strategies. For final analysis before deploying capital, 10,000 gives tighter estimates.
  • Confidence level — 90%, 95%, 99%, or 99.9%. This sets the VaR threshold and confidence interval bounds. The default 95% is appropriate for most use cases.

Three visualisations

After the simulation runs, you see three complementary charts:

  1. Return distribution — Histogram of final returns with your backtest marked. Green bars are profitable, red bars are losses.
  2. Equity curve fan — P5 through P95 percentile bands showing the range of equity paths. Interactive tooltips show all five percentiles at each trade.
  3. Drawdown distribution — Histogram of maximum drawdowns across all simulations.

Summary statistics

A statistics panel shows the expected return, standard deviation, VaR, probability of profit, average and worst drawdown, and the confidence interval — all calculated from the simulation results. These numbers are the basis for position sizing and risk decisions.

Drawdown envelope card

A lightweight Monte Carlo also runs automatically in the backtest results view, producing the drawdown envelope card. This shows where your backtest's actual drawdown sits within the Monte Carlo distribution — a quick visual check of whether your backtest experienced a typical or atypical drawdown.

Monte Carlo Simulation
Number of Simulations
100
500
1,000
5,000
10,000
Confidence Level
90%
95%
99%
99.9%
Input
Trades from backtest87 trades
Initial portfolio$10,000
Run Monte Carlo
Produces: Return distribution, equity curve fan, drawdown distribution
Configure simulations and confidence level, then run directly on your backtest results.

Limitations and Assumptions

Monte Carlo is powerful, but it rests on assumptions that are not always true. Understanding the limitations makes you a better user of the tool.

Trade independence

The fundamental assumption is that trades are independent — that one trade's outcome does not affect the next. Bootstrap resampling shuffles trades randomly, treating each one as interchangeable. In reality, trades are not fully independent:

  • Market regimes — Winning trades tend to cluster during trending markets, and losing trades cluster during choppy markets. Resampling breaks these clusters, potentially underestimating the drawdowns caused by consecutive losses during adverse regimes.
  • Serial correlation — Some strategies produce trades with correlated outcomes. An RSI mean-reversion strategy might generate a string of losers when the market shifts from mean-reverting to trending.

Position sizing is baked in

The simulation uses portfolio-relative returns, which means position sizing effects are already captured. If your backtest used fixed position sizes, the simulation reflects that. If it used compounding (reinvesting profits), the returns already incorporate that compounding. This is correct for assessing the specific configuration you tested, but it means changing position sizes after the fact requires re-running the backtest first.

Same trades, different order

Monte Carlo does not generate new trades. It resamples from the existing set. If your backtest had only 15 trades, the simulation is working with a very small sample, and the percentile estimates will be noisy. Strategies with more trades produce more reliable Monte Carlo statistics — aim for at least 30 trades and ideally 50 or more for meaningful results.

Not a forward-looking model

Monte Carlo tells you what could happen given the trades you already have. It does not predict what trades the strategy will produce in the future. If market conditions change and the strategy's win rate or payoff ratio shifts, the Monte Carlo distribution from the old trades becomes less relevant. Pair Monte Carlo with Walk-Forward Analysis for forward-looking validation.

Monte Carlo vs. Walk-Forward Analysis

Monte Carlo and Walk-Forward Analysis are complementary tools that answer different questions. Neither replaces the other.

What Monte Carlo tests

Monte Carlo tests the sensitivity of results to trade ordering. Given a fixed set of trades, it asks: "How much does the outcome depend on which trades happened when?" This is a test of outcome robustness — whether the strategy's result is stable or fragile.

What WFA tests

Walk-Forward Analysis tests whether the strategy's parameters generalise across time. It asks: "If I re-optimise periodically, do the parameters keep working on unseen data?" This is a test of parameter robustness — whether the strategy captures a genuine market pattern or just fits historical noise.

Using them together

The strongest validation combines both:

  1. WFA first — Validate that the strategy's parameters work out-of-sample across multiple time windows. This confirms the edge is real and the parameters are not overfit.
  2. Monte Carlo second — Run Monte Carlo on the validated strategy's trades to understand the range of drawdowns and returns you should size for. This converts a "the edge is real" conclusion into "here is how to manage the risk."

A strategy that passes WFA with good efficiency and also shows tight Monte Carlo bands has survived two independent dimensions of stress testing. The parameters generalise (WFA) and the outcome is stable (Monte Carlo). This is as much confidence as historical analysis can provide.

A Practical Monte Carlo Workflow

Here is a sensible workflow for incorporating Monte Carlo into your strategy research process.

Step 1: Complete your backtest

Monte Carlo operates on trade results, so you need a finished backtest first. Ensure the strategy has produced enough trades for meaningful statistics — at least 30, ideally 50 or more.

Step 2: Run Monte Carlo at 1,000 simulations

Start with 1,000 simulations at 95% confidence. This runs quickly and gives you a good initial picture. Check the probability of profit — if it is below 60%, the strategy's edge may not be strong enough to justify further analysis.

Step 3: Examine the fan chart

Look at the equity curve fan. Are the bands tight or wide? Does the P5 path stay above zero? Does the fan converge as the number of trades increases? Wide, diverging bands suggest the strategy is high-variance and may be difficult to trade with confidence.

Step 4: Check the drawdown distribution

Compare your backtest drawdown to the P95 drawdown from Monte Carlo. If the P95 is significantly worse, size your positions for the P95 scenario, not the backtest scenario. Calculate the scaling factor: Tolerance / P95 Drawdown.

Step 5: Refine at 10,000 simulations

If the strategy passes the initial screen, re-run at 10,000 simulations for tighter percentile estimates. The mean and VaR will stabilise, and you will get more reliable confidence intervals for your final risk calculations.

Step 6: Compare against alternatives

If you are evaluating multiple strategies, compare their Monte Carlo distributions side by side. Prefer the strategy with tighter bands and a smaller gap between mean and P95 drawdown, unless the wider-band strategy has a significantly higher expected return that justifies the volatility.

Related articles

Browse all learning paths