ai-ml

Monte Carlo Simulation in Trading

Monte Carlo simulation is a statistical technique that runs thousands of randomized scenarios based on a strategy's historical return distribution to estimate the range of possible future outcomes. In crypto trading, it's used to stress-test strategies, model drawdown risk, and estimate the probability of ruin before deploying real capital, rather than relying on a single backtest result that reflects only one path history happened to take.

What Is Monte Carlo Simulation in Trading?

Monte Carlo simulation crypto trading explained simply: it's a way of asking "what else could have happened?" instead of settling for "what did happen." Named after the Monte Carlo casino because it relies on repeated random sampling, the technique originated in the 1940s with physicist Stanislaw Ulam's work on nuclear chain reactions. Traders adopted it decades later to solve a problem that plagues every backtest: a single historical price path is just one draw from an infinite set of possible markets.

Here's the core idea. You take a trading strategy's historical trade returns, or the statistical properties of an asset's price movements, and generate hundreds or thousands of simulated alternate histories using randomized sampling. Each simulation reshuffles the sequence of wins and losses, or resamples returns from a probability distribution, producing a different equity curve. Run 10,000 of these and you get a distribution of outcomes rather than one number. That distribution tells you the probability of hitting a 40% drawdown, the odds your strategy goes to zero before it compounds, and the range of plausible ending balances a year from now.

Why One Backtest Isn't Enough

I've seen traders get burned by treating a single backtest as gospel. A strategy that returned 85% over 2023-2024 on Bitcoin looks fantastic until you realize that specific sequence of returns was just one of thousands of ways those trades could have played out. Reorder the same trades — same win rate, same average win/loss — and you might discover a version of history where the strategy blows through a 50% drawdown early on and never recovers.

This is the sequence-of-returns risk that Monte Carlo simulation exposes. Two portfolios with identical average returns can have wildly different survival odds depending purely on the order losses arrive. A strategy that loses 20% five times in a row early behaves very differently than one where those same losses are spread evenly across three years, especially if you're using volatility-adjusted position sizing or compounding gains.

Key insight: A backtest shows you what happened. A Monte Carlo simulation shows you what was statistically likely to happen — and how bad the unlucky outcomes could get.

How Monte Carlo Simulation Works in Practice

  1. Gather trade data — Pull the historical returns (or trade-by-trade P&L) from a backtesting run or live trading log.
  2. Choose a resampling method — Either shuffle the actual trade sequence randomly (bootstrap resampling) or fit a statistical distribution to the returns and sample from it synthetically.
  3. Run thousands of iterations — Generate anywhere from 1,000 to 100,000 simulated equity curves, each representing a plausible alternate history.
  4. Analyze the distribution — Calculate percentiles for ending balance, maximum drawdown, and probability of ruin (account hitting zero or a stop-out threshold).
  5. Set risk parameters accordingly — Use the 5th and 95th percentile outcomes to size positions conservatively rather than optimistically extrapolating the single best-case backtest.

A basic Python implementation might look like this:

import numpy as np

trade_returns = np.array([...])  # historical per-trade returns
n_simulations = 10000
n_trades = len(trade_returns)

results = []
for _ in range(n_simulations):
    sampled = np.random.choice(trade_returns, size=n_trades, replace=True)
    equity_curve = np.cumprod(1 + sampled)
    results.append(equity_curve[-1])

results = np.array(results)
print("5th percentile:", np.percentile(results, 5))
print("95th percentile:", np.percentile(results, 95))

Where It's Used in Crypto Trading

  • Strategy validation — Confirming a strategy's edge holds up across randomized scenarios, complementing walk-forward analysis rather than replacing it.
  • Position sizing — Estimating the probability of drawdown at different leverage levels before committing capital, similar in spirit to the Kelly Criterion but simulation-based rather than formula-based.
  • Risk management — Modeling tail scenarios for portfolios exposed to correlated assets, feeding into broader Value at Risk calculations.
  • Options and derivatives pricing — Simulating underlying asset paths to price path-dependent payoffs, a technique borrowed directly from traditional quant finance.

Myth vs Reality

MythReality
Monte Carlo simulation predicts future pricesIt models probability ranges based on historical statistical properties, not forecasts
More simulations always means more accuracyBeyond a certain point (often 5,000-10,000 runs), returns diminish; the input data quality matters more
It replaces backtestingIt's a complementary stress test that reveals risk hidden inside a single backtest path
It works for any strategyStrategies with regime-dependent behavior need regime-switching models layered in, since simple resampling can miss structural shifts

Limitations Worth Understanding

Monte Carlo simulation assumes the future statistical behavior of your trades resembles the past. That assumption breaks down hard during genuine regime changes — think the FTX collapse in November 2022 or a sudden liquidity crunch that changes correlation structures across an entire portfolio. Garbage in, garbage out applies here too: if the underlying trade sample is small (say, under 50 trades) or overfit, the simulation just multiplies bad assumptions across thousands of paths rather than fixing them. It's a risk-sizing tool, not a crystal ball, and pairing it with rigorous backtesting and out-of-sample testing gives a far more honest picture of strategy viability than either technique alone. For a deeper technical grounding in the math, Investopedia's overview of the Monte Carlo simulation method remains a solid starting reference point.