Appearance
Monte Carlo
A backtest only shows you one historical path. Monte Carlo asks: "What range of results could this strategy's return stream have produced?"
MarketHeist resamples your strategy's bar-by-bar returns thousands of times and builds a distribution of outcomes: how much the final result could vary, how likely a severe loss was along the way, and whether the observed drawdown was typical or lucky.
How it works
After running a backtest, click Monte Carlo in the analysis panel. MarketHeist runs two kinds of simulation on the strategy's actual return series (e.g., 3,000 daily returns), 1,000 of each by default:
- Block bootstrap. Each simulated path is built from blocks of consecutive returns (by default the cube root of the number of bars: about 14 days for 3,000 daily returns; you can pick longer blocks), drawn at random with replacement until the path is as long as the backtest. Some stretches of history appear twice in a path, others not at all. These paths drive the fan chart, the final-equity distribution and the probability of ruin.
- Reshuffle. The same returns in a random order. This gives an order risk figure: how deep the drawdown could be if the same gains and losses arrived in random order.
Results are seeded, so running the same backtest again gives the same numbers.
INFO
Why two methods? A reshuffle keeps exactly the same set of returns, so every reshuffled path ends at the same final value: the same numbers multiplied in a different order. It can say nothing about the range of final outcomes, only about the path along the way. The block bootstrap varies which returns occur, so final values differ from path to path. Drawing short blocks rather than single days keeps short bursts of volatility together; longer market regimes (a year-long bear market, or a trend rule sitting in cash for months) are cut into pieces, so for such strategies try a longer block length (21, 63 or 252 bars) and compare the spread. Neither method models regime changes that are not in the backtest history.
Reading the fan chart and final equity
The fan chart shows percentile bands (5th–95th and 25th–75th) of the bootstrapped equity paths, with the median dashed and your actual curve on top. The summary lists the final-equity distribution:
- Median (p50): the typical final value across resampled histories.
- p5: the bad case. 95% of resampled paths end higher than this.
- p95: the good case.
- Resamples ending lower: where your actual result sits in the distribution. Near 50% is typical; a value near 100% means the actual history was among the best this return stream produces.
A narrow band means the result does not hinge on a few exceptional stretches of history. A wide band means the final result is sensitive to which periods happened to occur: a few strong or weak months drive it.
Order risk (drawdown)
The reshuffle compares your actual maximum drawdown with the maximum drawdowns of the reshuffled paths:
- Reshuffled max DD p50 / p5: the typical and the bad-case drawdown from the same returns in random order.
- Reshuffles deeper than actual: the share of reshuffled paths with a deeper drawdown than your curve.
Read this as a stress figure, not as a verdict on luck. For buy-and-hold or always-invested strategies, a high share does suggest the real sequence was kind. For timing rules (trend filters, moving-average crossovers) it is expected: the rule is designed to be out of the market during clustered sell-offs, and a random reorder throws that timing away. A golden-cross strategy typically shows most reshuffles deeper than its actual drawdown for exactly this reason.
Probability of ruin
Probability of ruin is the fraction of bootstrapped paths that fall below a set share of the starting value (e.g., a 50% loss, 0.5× the start) at any point during the simulation. It is measured from the start, not from the previous peak. This is distinct from final terminal value — it captures the risk of hitting an unacceptable loss at some point along the way, even if the strategy eventually recovers.
| Probability of Ruin | Interpretation |
|---|---|
| < 1% | Very low risk of catastrophic drawdown |
| 1–5% | Manageable — acceptable for many risk tolerances |
| 5–15% | Elevated — consider reducing position size or adding risk controls |
| > 15% | High — the strategy has a meaningful probability of severe loss |
TIP
Probability of ruin is most useful when you're deciding on position sizing or maximum leverage. A strategy with 2% probability of -50% ruin at 1× leverage may have 15% probability of ruin at 2× leverage — Monte Carlo helps quantify this scaling.
What Monte Carlo does and does not tell you
It does tell you:
- The range of final outcomes this strategy's return stream could have produced (block bootstrap)
- Whether the observed backtest result was an outlier or a typical result for that return stream
- Sequence-of-returns risk — how deep the drawdown could have been with the same returns in a different order (reshuffle)
It does not tell you:
- Whether the strategy will perform similarly in the future (that requires walk-forward validation)
- How the strategy performs in regimes not represented in the backtest history
- Whether parameters are overfit (that requires parameter sweep and walk-forward)
Combining with other validation tools
Monte Carlo is most useful as a final stress-test after you've already validated robustness through parameter sweep and walk-forward:
- Parameter Sweep → confirms parameters are in a stable plateau, not a lucky spike
- Walk-Forward Optimization → confirms performance holds on unseen data
- Monte Carlo → quantifies the probability range of outcomes and catastrophic-loss risk
Next steps
- Walk-Forward Optimization — out-of-sample validation
- Metrics Glossary — formal definitions of all statistics