Monte Carlo simulations, kept simple

Monte Carlo simulation, kept simple: reshuffle or resample a backtest's trades many times to see the range of outcomes instead of one lucky path.

Part of the Backtesting and Research track on Agenticks. About 11 minutes, written for a advanced reader.

Read first: What is backtesting, Reading results 3: drawdown and the equity curve, Sample size and why ten trades mean nothing.

Last reviewed .

Risk notice. Backtested and hypothetical results are simulated: no trades were placed, the rules were applied to past data with the benefit of hindsight, and they may not reflect liquidity, slippage or every cost. Past results, real or simulated, do not predict future results.

Key takeaways

A backtest hands you one equity curve: one line that climbs and dips its way to a final number. It is tempting to treat that line as the truth. The problem is that the exact path you got was partly luck. The same trades in a slightly different order would have produced a different ride and a different worst drop. A Monte Carlo simulation is a simple trick that exposes this. It takes the trades you already have and replays them many times in different orders, building not one line but a whole fan of possible lines.

The name sounds intimidating, so set it aside for a second. The idea is just reshuffling. Imagine your backtest produced 200 trades, a mix of wins and losses. Write each trade result on a card. Now shuffle the deck and deal the cards out in a new order, adding them up as you go to draw a fresh equity curve. Shuffle again, draw another. Do that a few thousand times and you have a few thousand equity curves, all made from the exact same wins and losses, just dealt in different sequences.

Same trades, many orders

Monte Carlo keeps your wins and losses fixed and only changes their order. Each reshuffle is a path the same edge could plausibly have taken. The fan of paths shows how much of your single result was the edge and how much was the luck of the sequence.

Why does order matter so much? Because losing streaks cluster differently each time you shuffle. In one ordering, five losers happen to land early, while the account is small and survives. In another ordering, those same five losers land back to back near a high, carving out a much deeper hole. When you only reorder, the total profit at the very end is identical, because the same trades are present in every shuffle. What changes is the path: the size of the worst dip, and how long the account spent underwater. Order does not change the destination, but it dramatically changes the trip.

Worked example: six trades, two orders

Three wins of +$300 and three losses of -$200. Same trades, dealt in two different orders.

Order A: win, win, win, loss, loss, loss (Running total after each trade)300, 600, 900, 700, 500, 300
Order A, worst drawdown (From the $900 peak down to $300)$600
Order B: win, loss, win, loss, win, loss (Running total after each trade)300, 100, 400, 200, 500, 300
Order B, worst drawdown (Each loss only gives back one win's worth)$200
Final total, both orders (3 x 300 - 3 x 200)+$300
Same trades, same endingWorst drop of $600 or $200

Illustrative numbers. Resampling with replacement could also draw, say, four losses and two wins, ending at -$200.

Final profit stays the same, the worst drop does not

Pure reshuffling of the same trades always ends at the same total profit, since no trade is added or removed. But the deepest peak-to-trough fall along the way, the maximum drawdown, swings widely from one ordering to the next. That swing is exactly the risk Monte Carlo is built to reveal.

Once you have the fan of curves, you stop reading single numbers and start reading a range. Take the maximum drawdown from each of the thousands of reshuffled runs and line them all up. Most runs cluster around a typical drawdown. A lucky few barely dip at all. And a worrying tail of runs dig far deeper than the one your original backtest happened to show. That tail is the point. Your single backtest gave you one drawdown figure; Monte Carlo tells you it could realistically have been a lot worse, purely from a different shuffle.

There is a second common version, and it is the one many tools actually use: resampling with replacement, also called a bootstrap. Instead of dealing each card exactly once, you draw a card at random, note it, put it back, and draw again, as many times as there were trades. Some trades get drawn twice, some not at all. Now the final total changes from path to path as well as the drawdown, so the simulation reports a range of returns, from a bad case to a good case, as well as a range of drawdowns. Both versions answer the same honest question: given the trades this rule actually produced, how different could the result have looked? Reshuffling isolates the effect of order. Resampling also asks what happens if the mix of wins and losses had come out a little differently, which is usually the bigger risk.

A resampled Monte Carlo of a losing strategy. Every band of the fan slopes down, from the bad case to the good case, which is what a strategy without an edge looks like: no reordering or resampling rescues it.

A useful way to read the output is in percentiles. A common one is the worst five percent of runs. If ninety-five out of a hundred reshuffles stayed inside a 20 percent drawdown but the worst five dug past 35 percent, then 35 percent is the kind of pain you should be prepared for, not the gentle 18 percent your single backtest happened to print. Planning around the friendly middle of the fan is how people get caught out. Planning around the ugly tail is the entire reason to run the simulation.

You run a Monte Carlo by reshuffling the same 200 trades thousands of times. What stays the same across every reshuffle, and what changes? The final total profit stays the same; the maximum drawdown along the way changes Right. No trade is added or removed, so the end profit is fixed. Only the order changes, and order is what decides how deep the worst drawdown gets on each path.

Reshuffle
Deal the same trades in a new order to draw a fresh curve
The fan of curves
Thousands of paths built from the same wins and losses
Worst-case tail
The small share of runs with the deepest drawdowns
Distribution
A range of outcomes instead of one single number

Put the steps of a simple trade-reshuffling Monte Carlo in the order you would actually run them.

  1. Collect the list of trade results from a finished backtest
  2. Shuffle the trades into a new random order
  3. Add them up in that order to draw one equity curve
  4. Repeat thousands of times and collect every result
  5. Read the range, especially the worst-case tail

Monte Carlo is honest only as far as your inputs are honest. It reshuffles the trades you fed it, so it cannot fix a bad backtest. If your sample size was tiny, reshuffling forty trades just produces a fan of unreliable curves; the simulation looks scientific but the foundation is sand. It also assumes your trades are interchangeable, which understates risk if your real losses tend to cluster in trends or news events rather than scatter randomly. And it never predicts the future, because every card in the deck came from the past. The sample size lesson covers how many trades it takes before the fan means much, and variance, luck and skill shows how to use the range to judge whether a result was lucky.

It stresses a backtest, it does not bless one

Monte Carlo shows the spread of luck inside the trades you already have. It cannot create an edge that was not there, rescue too-small a sample, or forecast tomorrow. Treat it as a stress test on one backtest, never as proof that a strategy will work going forward.

reshuffles range drawdown

Why is the worst-case tail of a Monte Carlo usually the most useful part to read? Because it shows a realistic deep drawdown the single backtest happened to dodge, so you can plan for it Yes. Your one backtest showed one path. The tail reveals how much worse a different, equally plausible ordering could have been, which is what you actually need to survive.

You can read a range, not just one path

Monte Carlo reshuffles the same trades into thousands of orderings. The final profit holds steady while the worst drawdown swings, and reading the worst-case tail tells you the risk a single equity curve hides. It stresses a backtest; it never predicts the future.

Check your understanding

In the worked example, both orders end at +$300. Why is the worst drawdown $600 in one and $200 in the other?
In the first order the three losses arrive back to back after the peak; in the second they are spread out. Clustered losses dig one deep hole. Spread-out losses dig several shallow ones.
How does resampling with replacement differ from reshuffling?
Trades are drawn at random, so some appear twice and others not at all, and the final total can change. That is why a resampled Monte Carlo reports a range of final returns, not just a range of drawdowns.
A Monte Carlo built from 25 trades shows a narrow, comforting range. What is the honest read?
Twenty-five trades is too few; the simulation can only rearrange the little evidence there is. A Monte Carlo cannot add information. A thin sample gives a thin, unreliable fan however neat it looks.

Common questions

What is a Monte Carlo simulation in trading?
It is a method that takes the trades from a backtest and reshuffles or resamples them many times to build a range of possible equity curves. Instead of one path through history, you see thousands of plausible paths made from the same wins and losses, which shows how much luck shaped the single result you happened to get.
Why reshuffle trades that already happened?
The order of your wins and losses was partly luck. The same set of trades in a different order produces a different equity curve and a different worst drawdown. Reshuffling shows the spread of outcomes that the same edge could have produced, so you are not fooled by the one ordering you saw.
What does Monte Carlo actually tell me?
It turns a single number into a distribution. Instead of one final profit and one maximum drawdown, you get a range: a typical outcome, a good case, and a bad case. The bad case is the part most people skip, and it is usually the most useful.
Does Monte Carlo predict the future?
No. It only reshuffles trades you already have, so it is bounded by your sample and your assumptions. If the underlying edge changes or the sample was too small, Monte Carlo cannot rescue it. It is a way to stress one backtest, not a forecast.

Terms defined in this lesson

Continue

Sources

Written and reviewed by the Agenticks Learn editorial team. How we write and check lessons.

Agenticks Learn is general education. It is not financial, investment, tax or legal advice, it does not take your situation into account, and nothing on it is a recommendation to buy, sell or hold any security or to open any account. Examples use illustrative numbers. Investing involves risk, including losing money you put in, and past performance does not predict future results. Tax rules and limits change; the official sources linked in each lesson are the final word.