TradeLabs AILearn

Monte Carlo Simulation

Monte Carlo simulation generates thousands of possible outcomes to show the range of results. Learn trade resampling, drawdown estimates and the limits.

Intermediate3 min readUpdated 3 Oct 2026
Markdown
Lesson 13 of 38

A backtest shows one path through history: one particular order of wins and losses. But the future could unfold in countless other ways. Monte Carlo simulation generates thousands of plausible alternative paths by resampling or randomly generating returns, then measures the distribution of outcomes. It answers questions a single backtest cannot: how bad could the drawdown get, how likely is a losing year, what are the odds of ruin? For option pricing applications, see Monte Carlo Option Pricing.

Common approaches#

MethodHow it worksCaptures
Trade resamplingShuffle or resample historical trades with replacementDifferent orderings of wins and losses
Return bootstrappingResample daily or monthly returns, often in blocksReturn distribution and some clustering. See Bootstrap and Permutation Tests
Parametric simulationGenerate returns from a fitted distribution (normal, Student t, GARCH)Assumed distribution and volatility dynamics
Parameter perturbationRandomly vary strategy parametersSensitivity to settings. See Robustness and Stress Testing
Synthetic price pathsSimulate prices and re run the strategyBehaviour on unseen patterns

Drawdown analysis#

Risk of ruin and probability estimates#

Monte Carlo makes it easy to estimate:

  • Probability of a losing year or losing month.
  • Probability of hitting a drawdown limit such as 20%.
  • Probability of ruin at different position sizes. See Risk of Ruin.
  • Range of final account values after a set number of trades.
  • Time to recover from drawdowns.

A simple trade resampling procedure#

  1. Collect the list of trade returns from the backtest (after costs).
  2. Draw a random sample of the same size with replacement.
  3. Compound them into an equity curve using your sizing rules.
  4. Record statistics: final return, maximum drawdown, longest losing streak.
  5. Repeat 5,000 to 10,000 times.
  6. Analyse the distribution of each statistic.
import numpy as np
trades = np.array([...])          # trade returns as fractions, e.g. 0.012
rng = np.random.default_rng(0)
dd = []
for _ in range(10_000):
    path = np.cumprod(1 + rng.choice(trades, size=len(trades), replace=True))
    peak = np.maximum.accumulate(path)
    dd.append(((path - peak) / peak).min())
print(np.percentile(dd, [50, 5, 1]))

Limits#

LimitationExplanation
Garbage in, garbage outIf the backtest is overfit or biased, simulations inherit the problem
Independence assumptionSimple resampling ignores clustering of losses; block methods help
No new regimesResampling cannot create market conditions absent from history. See Structural Breaks and Regime Changes
Fat tailsParametric normal simulations understate extremes. See Fat Tails
False precisionThousands of simulations can look authoritative while resting on shaky inputs

Monte Carlo vs stress testing#

Monte Carlo explores the range of outcomes implied by your data or assumptions. Stress testing deliberately imposes extreme scenarios, such as a 2008 style crash or a sudden volatility spike, that may not appear in your sample. Use both. See Stress Testing and Scenario Analysis.

Using results for sizing#

A practical approach is to choose position size so that the 95th percentile simulated drawdown stays within the largest drawdown you could tolerate without abandoning the strategy. If simulations show a 1 in 20 chance of a 30% drawdown and your limit is 20%, cut risk per trade by roughly a third and rerun the simulation. See Maximum Drawdown.

Frequently asked questions#

What is Monte Carlo simulation in trading?#

A method that generates many alternative sequences of returns or trades to estimate the range of possible outcomes, such as drawdowns and final returns.

How many Monte Carlo runs do I need?#

Typically several thousand, such as 5,000 to 10,000, which gives stable estimates of most percentiles.

Can Monte Carlo prove a strategy will work?#

No. It shows the range of outcomes implied by past data and assumptions, but cannot fix biases in the backtest or predict new market regimes.

Next, learn to choose parameters without overfitting in Parameter Optimization.

Check your understanding

3 quick questions on this lesson. Get them all right to finish it.

Turn on JavaScript to take the quiz.

Finished this lesson?Sign in to save your progress across devices.
Next lessonParameter OptimizationChoosing strategy parameters by optimisation risks overfitting. Learn grid and random search, robustness surfaces, walk forward optimisation and sensible defaults.

Mentioned in