Skip to content

GuideHow much evidence is enough

Monte Carlo simulation in trading: what it shows about your backtest’s drawdowns

Monte Carlo simulation rebuilds your backtest thousands of times from its own trades, in new orders or random draws, to show the range of drawdowns those trades could have produced. It turns one history into a range; it can’t make an overfit backtest honest.

Key takeaways

  • Monte Carlo simulation rebuilds a backtest’s equity curve thousands of times from its own trades to show the range of drawdowns and results they could have produced.
  • Shuffling changes the path but never the total: one invented 10-trade backtest made $1,000 in every order, with drawdowns from $200 to $800.
  • Look at the bad end of the spread, such as the 95th-percentile drawdown, next to the backtest’s single figure; even that isn’t the worst case.
  • Doubling size doubles every drawdown, but the share of paths that hit a fixed loss limit rises much faster: from 0 to 26% to 83% for one to three contracts in the example.
  • It can’t fix an overfit backtest or invent losses the history never had, and plain shuffles understate losses that come in streaks.

Monte Carlo simulation in trading rebuilds a strategy’s equity curve (the running account total) thousands of times from its own backtest trades, shuffled into new orders or drawn at random. The spread shows the range of results, above all drawdowns, that the same trades could have produced. In one invented 10-trade backtest, the drawdown (deepest fall from a high) was $200, yet nearly 1 in 4 reshuffled orders fell $600 or more.

What is a Monte Carlo drawdown?

A Monte Carlo drawdown is the range of worst drawdowns the same trades produce in other orders, usually read as a median and a bad-end figure such as the 95th percentile. A drawdown is the fall from the highest point so far; maximum drawdown is the deepest one. Shuffling never changes the total, only where the losing streaks fall.

Those 10 trades can come in 210 different orders. Only back-to-back losses push the drawdown past $200, since one $300 win repays a $200 loss. Picture the 6 wins with 7 gaps around them (before, between and after) and drop the losses into the gaps:

  • All in separate gaps: 35 ways (7 × 6 × 5 × 4 ÷ 24).
  • One pair and two singles: 7 gaps for the pair × 15 ways to place the singles in the other 6 (6 × 5 ÷ 2) = 105.
  • Two pairs: 21 ways (7 × 6 ÷ 2). In 6 of them a single win separates the pairs; it repays $300 of the first pair’s $400, so the fall reaches $500.
  • Three together plus one: 7 × 6 = 42.
  • All four together: 7.
Worst drawdown Orders Share At or below this What it takes
$200 35 17% 17% No two losses in a row
$400 120 57% 74% One pair, or two pairs two or more wins apart
$500 6 3% 77% Two pairs with one win between
$600 42 20% 97% Three losses in a row, plus one on its own
$800 7 3% 100% All four in a row

In the “at or below” column, the median (the middle order) is where it first passes 50%: $400. The 95th-percentile drawdown, the level 95% of orders stay at or below, is where it first passes 95%: $600. Nearly 1 order in 4 (49 of 210, about 23%) reaches $600 or more.

A real backtest has too many trades to list every order, so a simulation draws a few thousand orders at random and reads the spread from them. That random sampling is the Monte Carlo part.

What does each Monte Carlo method change, and what does it miss?

Each Monte Carlo method changes one thing about your backtest and keeps the rest, so each one misses something.

Method What it changes Question it answers What it misses
Shuffle The order of the same trades How deep could drawdowns and losing streaks get? Clustered losses (it treats trades as independent); the total never changes
Resample (bootstrap) Which trades occur: draws with replacement, so some repeat and some drop out How much could the total and the drawdown vary? Assumes one trade’s result says nothing about the next
Block resample Which runs of consecutive trades or days occur The same, keeping losing streaks that bunch together Depends on the block length you pick
Permutation test The market itself: bar-to-bar price changes shuffled into histories with no pattern, or each entry moved to a random date Could a rule with no edge have done this well? Tests luck, not drawdown

On the example’s 10 trades, each resampled draw is a win 6 times in 10. A set of 10 draws loses money when it picks 3 wins or fewer, about 5.5% of the time (binomial odds), and ends at break-even or worse about 17% of the time.

For a permutation test, if 30 of 1,000 no-pattern histories do as well as the real one, that 3% is the test’s p-value: how often a rule with no edge matched the result (permutation tests on Wikipedia). Some tools instead generate random price paths from an assumed return distribution; that tests a model of the market, not your own trades.

How do you run a Monte Carlo simulation on a trading strategy?

A Monte Carlo run needs only the backtest’s trade list after costs and a spreadsheet; the rest is shuffling and counting.

  1. Export the trades after costs. Use each trade’s profit or loss after commission and slippage (how costs eat an edge).
  2. Merge trades that belong together. A position added to three times is one bet. Shuffled apart, they make losses look less bunched than they were.
  3. Pick the method. A shuffle for the drawdown range; a resample, or a block resample if losses come in streaks, for how much the whole result could vary.
  4. Build one path. Put the trade results in column A, say 200 trades in A2:A201. Shuffle them into column B with a formula: =SORTBY(A2:A201, RANDARRAY(200)) in Excel, or =SORT(A2:A201, RANDARRAY(200), TRUE) in Google Sheets. Column C is the running total of B (the equity), column D the highest value of C so far (starting from 0), and column E is D minus C. The largest value in column E is that path’s worst drawdown. In code: shuffle, running sum, running maximum, largest gap.
  5. Repeat a few thousand times. In Excel, list 1 to 2,000 down a column and make it a one-variable data table (What-If Analysis) with an empty cell as the input and the path’s worst drawdown as the output. Each row then recalculates a fresh shuffle. Google Sheets has no data table, so use a short script.
  6. Take the percentiles. Sort the recorded drawdowns: the middle one is the median, and the one 95% of the way up is the 95th percentile.
  7. Count the paths that cross your limit. If you’d stop trading after losing a set amount, such as a prop firm’s max loss, count the share of paths that reach it. That share estimates your risk of ruin for these trades. In the 10-trade example, a trailing limit $500 below the highest point so far is reached in 55 of 210 orders, about 26%.

Where does your backtest’s drawdown fall in the range?

The backtest’s own worst drawdown, placed inside the simulated range, suggests how kind history’s order was. In the example, $200 sits below the $400 median: history dealt a kind order. A drawdown near the median is an ordinary order.

A drawdown deeper than most paths means history’s order was among the worst, and the simulation can’t promise a better one next time. Quantpedia’s worked example on a commodity futures strategy found that case: more than 95% of shuffled monthly paths had a smaller drawdown than the original. Wherever yours falls, a spread built from too few trades can’t be trusted (how many trades a backtest needs).

How does position size change the Monte Carlo drawdown?

Doubling size doubles every drawdown, but the share of paths that hit a fixed loss limit jumps much faster: in the example, from 0 to 26% to 83% for one to three contracts, against a $1,000 limit (trailing, as in step 7):

Contracts Total (every order) Median drawdown 95th-percentile drawdown Orders reaching $1,000
1 $1,000 $400 $600 0 of 210
2 $2,000 $800 $1,200 55 of 210 (26%)
3 $3,000 $1,200 $1,800 175 of 210 (83%)

This is arithmetic, not a recommendation: how deep a drawdown you can sit through is your call.

When does Monte Carlo understate your risk?

Monte Carlo understates risk when your losses come in streaks or your trades were too good to begin with.

A simulation reshuffles the trades it’s given, flaws included. Trades from a strategy tuned until it fit noise stay too good in every path, and so do fills a test could only get with look-ahead bias. Is your backtest overfit? lists the checks for the first.

Plain shuffles and resamples also treat trades as independent, so they spread out losses that come in streaks. A check you can run on your own list: run a plain resample and a block resample by week on the same trades. If the block version’s 95th percentile is clearly deeper, your losses cluster, and plain shuffles and resamples understate them.

The step a spreadsheet can’t do for you is the first one: a trade list after realistic costs. Kwaant builds that list for an ES or NQ strategy you describe in plain English, and Monte Carlo is among the stress tests it runs on it.

Sources and further reading

Questions people ask

What is the meaning of Monte Carlo in trading?

In trading, Monte Carlo means testing a strategy by building many random versions of its results, usually from reshuffled or resampled backtest trades, and reading the range. The name comes from the Monte Carlo Casino in Monaco: scientists at Los Alamos named the method in the 1940s after the casino where Stanislaw Ulam’s uncle gambled.

How many runs does a Monte Carlo test need?

Enough that the answer stops moving. Run a few thousand paths, then run the whole set again (recalculate a spreadsheet, or use a new random seed in code); if the 95th-percentile drawdown changes by more than a few percent, run more. More runs sharpen the estimate from the trades you have; they can’t make up for too few trades.

Monte Carlo vs walk-forward analysis: what’s the difference?

Walk-forward analysis checks whether a strategy’s tuning holds up on data the tuning never saw. Monte Carlo takes the trades you already have and shows how differently they could have played out. Running Monte Carlo on a walk-forward’s out-of-sample trades combines the two.

Is a Monte Carlo permutation test the same as a trade shuffle?

No. A trade shuffle reorders a strategy’s own trades to show the drawdown range. A permutation test shuffles bar-to-bar price changes, or moves each entry to a random date, and reruns the rules, to see how often a rule with no real edge would do as well as yours.

Can Monte Carlo tell you if a strategy will pass a prop firm challenge?

Not on its own. It can estimate how often the same trades, in other orders, would hit the max loss before the profit target, if each path stops at whichever comes first. That estimate is only as good as the trades: if the backtest is overfit, it’s too optimistic.

General education about testing strategies, not investment advice. Figures are computer-drawn illustrations, not real market data.