WhitmanTrading

Monte Carlo Simulation for Traders: 10,000 Reshuffles of a Real Trade List

A Monte Carlo simulation for traders takes the trades from a backtest and replays them thousands of times in random orders, or drawn at random with repeats, to see the range of drawdowns, losing streaks and final results the same trades could have produced. It turns one historical path into a spread of possible paths.

A Monte Carlo simulation, in trading, is a way to stress a backtest by replaying its trades thousands of times in a different order or a different mix. A single backtest shows one path through history; the simulation shows the range of paths the same trades could have taken, and how bad the worst of them looked along the way.

The method runs on random draws, and nothing about it predicts the future. It asks a narrower question: given these trades, how much of what happened was the edge, and how much was the order they arrived in?

How it works

Start with a finished trade list. Every backtest ends with a list of trades, each with a percentage gain or loss. That list is the raw material; the simulation never invents a trade.

Pick one of two methods. The first reshuffles the list: the same trades, every one used exactly once, in a new random order. The second resamples it: a new list of the same length, drawn at random from the original with repeats allowed, so a big loser might appear twice and a big winner not at all.

Replay each list as an account. Compound the trades one after another, track the running peak, and record the deepest fall from a peak, the longest run of losing trades and the ending balance.

Repeat thousands of times, then read the spread. Sort the 10,000 drawdowns and read the middle, the 95th percentile and the worst. The historical backtest is just one of those paths, and the simulation shows whether it was a lucky one.

Shuffling and resampling answer different questions

Shuffling only changes the order. Compounding multiplies the same numbers together, and multiplication does not care about order, so every shuffled run ends at exactly the same balance. What shuffling changes is the path: how deep the drawdown got and how long the worst losing run lasted.

Resampling changes the mix as well. Because trades can repeat or drop out, some runs hold more losers than the backtest did and some hold fewer. That spreads the ending balance too, which makes it a rough way to ask how much the result depended on a handful of trades.

Neither method knows about regimes. Both treat every trade as interchangeable, as if a trade from a calm year could just as well have happened in a crash. Real losses tend to cluster, and a random shuffle breaks that cluster apart.

A worked example

Take a hypothetical $10,000 account and four trades: +10%, +10%, -10% and -10%.

The ending is fixed. In any order, $10,000 x 1.10 x 1.10 x 0.90 x 0.90 = $9,801. The account loses $199 however the trades are arranged.

The ride is not.

Same four trades, same final $9,801, and drawdowns of 19.0% or 10.9% depending on luck. A backtest that happened to alternate would report 10.9% and look safer than the trades really are.

The original data

The trade list. To show the method on real prices rather than invented ones, this site ran one simple rule on SPY daily closes from 29 January 1993 to 25 September 2026: buy at the close when the close is above its 200-day average and the two-day RSI is below 10, and sell at the first later close above the 5-day average. One position at a time, all capital in each trade, and no costs or dividends. It is a test list for this page, not a recommended strategy. Every trade is in the trade file.

What the rule produced. 261 trades from 22 November 1993 to 11 September 2026, held a median of 3 sessions and in the market on 868 of the 8,472 sessions. 200 closed above their entry and 61 below. The median trade was +0.83%, the worst -10.16% (27 July to 11 August 2011) and the best +5.59%. Compounded in the order they happened, $10,000 became $52,016, a multiple of 5.2016. SPY’s own price rose 17.6 times over the full span, so the rule is no match for simply holding.

The historical path. The deepest fall in the actual order was 10.86%, from the exit on 26 May 2011 to the exit on 11 August 2011, and the longest losing run was 4 trades in a row.

10,000 shuffles (seed 53). Every run ended at 5.2016 times, as the arithmetic says it must. The maximum drawdown had a median of 10.90%, a 95th percentile of 15.43% and a worst case of 22.55%. 648 of the 10,000 runs went past 15%, and 18 past 20%. The shallowest run was 10.16%, the size of the single worst trade, which no order can avoid. The longest losing run had a median of 3 trades, a 95th percentile of 5 and a worst case of 9, and 300 runs had a streak of 6 or more.

10,000 resamples with repeats (seed 5353). The ending multiple ranged from 3.471 at the 5th percentile to 7.748 at the 95th, with a median of 5.247. None of the 10,000 runs lost money overall. The maximum drawdown had a 95th percentile of 16.69%.

Horizontal bars comparing the 10.86% historical drawdown of 261 SPY test trades with the median, 95th percentile and worst drawdowns from 10,000 shuffles and the 95th percentile from 10,000 resamples.
Deepest fall from a peak for 261 SPY test trades: the historical order against 10,000 shuffles and 10,000 resamples, 1993 to 2026. Source: Yahoo Finance, SPY daily closes (m53-spy-rsi2-monte-carlo-10000-runs.csv).

What that says. The history this rule actually delivered sat in the middle of the pack: 5,072 of the 10,000 shuffles were at least as deep. But a trader sizing from the backtest alone would have planned for about 11% and could reasonably have met 15% or more. Every run is listed in the simulation file.

What it cannot tell you

It cannot fix a biased trade list. If the rule was tuned on the same history, the trades already carry that overfitting, and 10,000 shuffles of them inherit it. Test the rule on data it has never seen first; see out-of-sample testing.

It cannot see trades that never happened. A crash worse than anything in the sample is not in the list, so it is not in any shuffle. The worst loss here was 10.16% because nothing worse occurred in these 261 trades, not because nothing worse can.

It measures at the trade exits only. This simulation marks the account when a trade closes. The fall inside an open trade can be deeper, and a trader feels that one too.

When it fails

Treating the median as the plan

The middle of the spread is the easy part. A plan built on the 10.90% median drawdown fails in roughly half the runs. The useful numbers are the 95th percentile and the worst case, and the position size has to survive those.

Shuffling trades that depend on each other

Clustered losses get spread thin. The 2011 drawdown came from trades close together in a falling market. A shuffle scatters them across 33 years, which can make deep drawdowns look rarer than a market that moves in regimes would make them.

Too few trades

A short list gives a false sense of precision. With 20 trades, 10,000 shuffles still only rearrange 20 numbers. The spread looks smooth because the computer ran many times, not because the evidence grew.

Confusing it with a forecast

A spread of past paths is not a probability of future ones. It describes these trades. Whether the next 261 trades look like them is a separate question that only new data answers.

Backtesting produces the trade list a simulation starts from, and its honest limits carry straight through.

Drawdown explains the measure this page leans on, and risk of ruin asks the same survival question with a formula instead of random draws.

The losing streak calculator gives the odds of a losing run of a given length at a given hit rate, which is a quick check against the streaks above.

What I actually do

Before I trust a backtest, I want to know the drawdown it could have handed me, not just the one it did. Run the shuffle, look at the 95th-percentile drawdown and the longest losing streak, and size the position so you could sit through both.

— Michael Whitman

This page is educational, not financial advice. Test every idea on your own charts before risking money.