◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Learn / Risk of Ruin: What Monte Carlo Reveals That a Single Backtest Hides
Backtesting

Risk of Ruin: What Monte Carlo Reveals That a Single Backtest Hides

A single backtest shows one equity path out of millions that the same trades could have produced. Risk of ruin is the probability that some plausible ordering breaches a threshold you cannot recover from, and Monte Carlo is how you estimate it. This article is educational only and not financial advice — nothing here measures or predicts profitability, only the fragility of a result you already have.

What is risk of ruin, and why can't one backtest show it?

Risk of ruin is the probability that your account draws down past a threshold you cannot recover from — a margin call, a hard stop-out, or simply the point where you stop trading the system. A single backtest cannot show it because a backtest is one ordering of your trades: the exact sequence history happened to deal. That sequence produced one equity curve, one maximum drawdown, one final number. It is a single sample from a distribution you never got to see.

The trades themselves carry an edge or they do not. But the order they arrive in is close to arbitrary — reshuffle the same wins and losses and you get a different drawdown every time, sometimes dramatically different. The curve you saw is not the truth about your strategy; it is one draw. Risk of ruin asks the harder question: across all the orderings those trades could plausibly have taken, in what fraction does the account breach the line?

Monte Carlo simulation answers that by resampling the trade list thousands of times and rebuilding the equity curve for each ordering. See our primer on [Monte Carlo simulation for backtests](/learn/monte-carlo-simulation-backtests) for the mechanics. None of this measures whether the strategy makes money — it measures how survivable the strategy is if the edge is real. That distinction is the whole point. Nothing here is a prediction of returns, and trading carries a substantial risk of loss.

Why is the median max drawdown usually worse than the one you saw?

Here is the uncomfortable arithmetic. Your historical ordering delivered some maximum drawdown. But that ordering was neither the best nor the worst case — it was just the one that happened. When you simulate thousands of alternative orderings of the same trades, roughly half of them produce a deeper maximum drawdown than the one you observed, and half produce a shallower one. The median simulated max drawdown is therefore a more honest central estimate than your single realized number, and it is frequently worse.

Worse still, drawdown is a running-maximum statistic: it only records the deepest trough. A few adjacent losers clustered by chance can carve a hole far below anything the historical sequence showed. Because the maximum is an extreme-value quantity, its distribution has a long left tail — the 95th-percentile drawdown across simulations can be a large multiple of the median.

So if you sized your position against the drawdown the backtest displayed, you almost certainly under-provisioned. You planned for a sample that was, by construction, no more than typical and quite possibly lucky. The defensible practice is to size against a high percentile of the simulated drawdown distribution — say the 95th — not against the single path history handed you. This is a caution about survival, not a promise of gains.

| Statistic from the same trade list | What it represents | | --- | --- | | Realized max drawdown (the backtest) | One draw — could sit anywhere in the distribution | | Median simulated max drawdown | ~50% of orderings are worse | | 95th-percentile simulated max drawdown | The deep-but-plausible case to plan around |

How does Monte Carlo actually estimate the probability of ruin?

The procedure is deliberately mechanical. Take your list of per-trade returns (as fractions of equity, not fixed dollar amounts, so compounding is modeled correctly). Then repeat many thousands of times: resample the trade sequence, replay it to build an equity curve, and record whether that curve ever crossed your ruin threshold. The fraction of runs that breached the line is your estimated risk of ruin. The distribution of maximum drawdowns across those runs is your drawdown profile.

There are two common resampling choices, and they answer different questions. Reshuffling without replacement keeps your exact set of trades and only varies their order — it isolates path-dependence, the sequence-of-luck effect. Resampling with replacement (a bootstrap) treats your trades as a sample from a larger population and lets some trades repeat or drop out — it also captures sampling uncertainty in the trade set itself. The bootstrap traces back to Efron's work in statistics; be explicit about which you ran, because they mean different things.

import numpy as np

def risk_of_ruin(returns, threshold=-0.30, n=20000, replace=True):
    r = np.asarray(returns, dtype=float)
    breaches, max_dds = 0, []
    for _ in range(n):
        idx = np.random.randint(0, len(r), len(r)) if replace \
              else np.random.permutation(len(r))
        eq = np.cumprod(1.0 + r[idx])
        dd = eq / np.maximum.accumulate(eq) - 1.0
        trough = dd.min()
        max_dds.append(trough)
        if trough <= threshold:
            breaches += 1
    return breaches / n, np.percentile(max_dds, [50, 95])

The code only reads each trade's own return and accumulates forward — no future information leaks into any step. If your underlying backtest had [look-ahead bias](/learn/look-ahead-bias), this simulation faithfully propagates that flaw; Monte Carlo cannot launder a contaminated trade list.

What does risk of ruin NOT tell you?

It does not tell you the strategy is profitable. Every number here is conditional on the edge you fed in being real and persistent. If the backtest was overfit, the trade list encodes an illusion, and simulating orderings of an illusion produces a confident, precise, and worthless risk-of-ruin figure. Garbage in, garbage bootstrapped. Screen for that failure first with the [Overfitting Check](/backtest/overfitting) and our explainer on [overfitting and curve-fitting](/learn/overfitting-curve-fitting-explained).

Monte Carlo of a trade list also assumes trades are roughly independent and drawn from a stable process. Real markets cluster: volatility arrives in bursts, losers correlate during regime breaks, and the calm decade your strategy trained on may simply end. Plain reshuffling breaks any autocorrelation your losses actually had, which can understate real-world ruin. If your strategy has serial dependence, a naive shuffle is optimistic. Complement it with [walk-forward analysis](/learn/walk-forward-analysis), which re-fits and re-tests across rolling windows and exposes regime dependence a static resample hides.

And it says nothing about statistical significance of the edge itself. For that, look to the multiple-testing literature — the [Deflated Sharpe Ratio](/learn/deflated-sharpe-ratio) from Bailey and Lopez de Prado, and the broader warnings from Harvey and Liu on how many strategies were tried before this one survived. Risk of ruin is a survival-planning tool built on top of an edge you have separately validated, not a substitute for validating it. Educational only; not financial advice.

How should you act on a risk-of-ruin number?

Treat it as a sizing and go/no-go input, never as encouragement. If the simulated 95th-percentile drawdown from your own trade list would breach the capital you are willing to lose, the strategy is too large for the account regardless of how good the average path looked. The fix is smaller size, not a smaller imagination about what can happen. Position sizing is where risk of ruin cashes out into a decision.

A workable sequence: first confirm the edge is not an artifact — enough trades, out-of-sample confirmation, no leakage. Our guides on [how many trades is enough](/learn/how-many-trades-is-enough) and [in-sample versus out-of-sample](/learn/in-sample-vs-out-of-sample) cover the prerequisites. Only then run the resampling, read the drawdown percentiles, and size so that even the ugly-but-plausible tail stays inside your survivable range. Then re-run it periodically as live trades accumulate, because your real trade list is the only sample that keeps updating.

You can generate the resampled drawdown distribution and a ruin estimate for your own results with the free [Backtest Health Check](/backtest) — it reshuffles your trade list and reports the percentiles rather than a single flattering path. And read [why most backtests fail](/learn/why-most-backtests-fail) for the wider set of ways a clean-looking curve misleads. The honest summary: risk of ruin measures how a real edge might still kill you through bad sequencing. It cannot tell you the edge is real, and it cannot tell you anything about profit. Trading involves a substantial risk of loss.

Key takeaways

Educational only — not financial advice. Trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro