Docs / Test and optimise

Monte Carlo simulation

Reshuffle a backtest's trades thousands of times to see the range of outcomes luck could have handed you — and the odds of ruin.

A backtest gives you one outcome: the trades in the exact order history dealt them. Monte Carlo asks a harder question — how much of that was the order? It takes your strategy's trades and reshuffles them thousands of times, so you can see the whole spread of results the same edge could plausibly have produced, not just the single path you happened to land on.

You run it from the Monte Carlo Sim tab, after a backtest.

What it answers#

The same set of trades, dealt in a different order, can end in a fortune or a blow-up. Monte Carlo shows you that spread.

One backtest is a single path; Monte Carlo reshuffles the trades into thousands of paths to reveal the range of outcomes equity time your backtest goal return bust threshold
Your backtest is one line through this fan. Monte Carlo draws the rest — and counts how many of them hit your goal, and how many fall through the floor.

Setting it up#

Three inputs on the config form:

ControlWhat it means
SimulationsHow many reshuffled paths to run. The default 1000 is plenty; more just smooths the estimate.
Bust Threshold (%)The drawdown you would call ruin, e.g. -20.
Goal Return (%)The return you are aiming for, e.g. 50.

Press run, and you get back two probabilities plus the full distribution.

Reading the result#

  • Bust Probability — the share of paths that hit your bust threshold. This is the number that matters most. A strategy with a lovely average return and a 30% chance of ruin is a strategy that ruins one trader in three.
  • Goal Probability — the share of paths that reached your goal return.
  • The distribution — the minimum, maximum, mean, median and 5th/95th percentile outcomes. The gap between the 5th and 95th percentile is the honest width of "what could happen": if it is enormous, your single backtest number was largely luck.
TIP

Judge a strategy by its bad paths, not its average. Two strategies with the same mean return are not equal if one has a 5% bust probability and the other 25%. The one you can live with is the one whose 5th-percentile outcome you could still stomach.

Where it fits#

Monte Carlo tests the sequencing luck in a backtest. Grid search tests the parameter luck — whether your settings were a robust plateau or a lucky spike. Run both before you trust a result, and then let paper trading test the only thing neither can: whether the edge still exists today.

Was this page helpful?