Monte Carlo simulation in trading: how to run and read it
What a Monte Carlo simulation does to a backtest, reshuffling vs resampling, how to run one on an MT5 trade list, a worked 200-trade example, and what it can't fix.

A Monte Carlo simulation in trading takes the trades from a backtest and replays them thousands of times in a random order, or redraws them at random, and records the drawdown, the longest losing streak and the final result of every run. Instead of one drawdown figure you get a spread of them. Size your risk from the bad end of that spread, the 95th percentile, not from the drawdown the backtest happened to show.
It answers a question a backtest can't: how much of the result depends on the order the trades arrived in?
Why one backtest isn't enough
A backtest gives you one sequence of trades. Its maximum drawdown depends on that sequence. If the losses happened to be spread between winners, the drawdown looks small. Put the same losses next to each other and it gets deep, even though the strategy, the win rate and the total profit are unchanged.
Live trading will produce its own order, and nothing says it will be as kind as the backtest's. A Monte Carlo simulation tries thousands of other orders the same trades could have come in, so you can see how unusual your backtest's drawdown was. Our guide to drawdowns and losing streaks explains why the deepest drawdown is usually still ahead of you. Monte Carlo puts a number on how much deeper it could go.
Reshuffle or resample: the two main methods
Both methods start from your list of closed trades. They differ in how they build each new run.
Reshuffling keeps every trade and changes only the order. Each run uses the same wins and losses, so the final profit is the same every time. What changes is the path: the drawdowns and the losing streaks. This is the one to use when the question is "how deep could the drawdown get with these trades?"
Resampling (statisticians call it bootstrapping) builds each run by picking trades from the list at random, with repeats allowed, until it has as many trades as the original. Some runs get more of the big winners and some get fewer, so the final result varies too. This is the one to use when the question is "how often would a run of this length make nothing at all?"

Some tools add stress on top: they skip a random share of trades (missed signals, a VPS that was down), add slippage to every trade, or widen the spread. These are worth running if your strategy has a small average trade, because costs hit those first.
How to run a Monte Carlo simulation on your trades
The MT5 Strategy Tester has no Monte Carlo option, so you export the trades and run the simulation outside MetaTrader. Four steps:

1. Export the trade list
After a backtest, right-click the Backtest tab and save the report as HTML or as an Excel file. The Deals table at the bottom lists every trade with its profit. In MT4, the Results tab of the Strategy Tester lists each order, and the Report tab can be saved as a detailed report. For a live or demo account, use the account history report instead. Our MT5 Strategy Tester guide covers the settings that make the trade list worth simulating in the first place: real ticks and your broker's real costs.
2. Convert each result to R
Divide each trade's profit or loss by the amount that trade risked. A $150 win on a trade that risked $100 is +1.5R. Working in R removes the effect of a growing or shrinking balance, so a trade from the start of the test counts the same as one from the end. If the EA trades a fixed lot size, you can skip this step and work in money.
3. Run thousands of random orders
In a spreadsheet, put the R values in one column and =RAND() in the next, sort by the random column, then add a running total, a running peak and the gap between them. The biggest gap is that run's maximum drawdown. Repeating that by hand gets tedious after a few runs. A short Python script with NumPy does 10,000 runs in seconds: shuffle the array, take the cumulative sum, subtract it from its running maximum and keep the largest value. Our article on algo trading with Python and MT5 shows how to get Python talking to MetaTrader.
For each run, record three numbers: the maximum drawdown, the longest losing streak and, if you resample, the final result.
4. Read the percentiles
Sort each set of numbers and read off the median (the middle run) and the 95th percentile (the run that 95% of runs were better than). The median tells you what a typical order looks like. The 95th percentile is a bad but realistic case, and it's the one to plan around.
A worked example: 200 trades, 10,000 shuffles
To show what the output looks like, we made up a trade list: 200 trades, 80 wins of +2R and 120 losses of −1R. That's a 40% win rate and a total of +40R. We put the trades in one random order and called it the backtest. Its maximum drawdown was 8R and its longest losing streak was 8 trades.
Then we reshuffled the same 200 trades 10,000 times:
- Median maximum drawdown: 12R.
- 95th percentile: 19R. The worst single run reached 33R.
- More than 98% of the runs had a drawdown at least as deep as the backtest's 8R.
- The longest losing streak had a median of 9 trades and a 95th percentile of 13.

So the backtest's drawdown was one of the luckiest orders those trades could have come in. Someone sizing their risk from the 8R would be planning for less than half of the 95th percentile.
Resampling the list 10,000 times told a second story. The median result was still +40R, but the 5th percentile was only +7R, and about 2% of runs ended at zero or below. Even with a real edge of +0.2R a trade, 200 trades is not always enough for it to show.
These ranges come from the 200 trades alone, so they say nothing about how the strategy will trade later.
How to use the results
The main use is sizing. Take the 95th percentile drawdown in R and multiply it by your risk per trade. In the example, 19R at 1% of the starting balance a trade is a 19% drawdown. If your risk is a percentage of the current balance, the figure comes out a little lower, because each loss is a bit smaller than the last. At 2% of the starting balance it would be 38%. If that is more than you could sit through without switching the strategy off, lower the risk until the 95th percentile drawdown is a number you can live with. Our guide to how much to risk per trade covers the other side of that decision.
The streak numbers help in the same way. If the 95th percentile streak is 13 losses, a run of 10 in live trading is no reason on its own to stop. A streak well past the simulated range is a better reason to look for a change in the market or a fault in the EA. Our article on how many losing trades in a row is normal has the odds for different win rates.
If you're judging someone else's EA, ask for the trade list, not just the report summary. If the seller's quoted maximum drawdown sits far below the median of your reshuffles, you know how lucky their test was.
When we test an EA, the drawdown from a single backtest is the number we trust least, because the same trades in another order can go much deeper. We read it next to the trade count and the out-of-sample results before we decide whether the EA is worth running on a demo account.
What Monte Carlo can't tell you
- It only rearranges the trades you give it. If the backtest was over-optimised, tested on bar data that flatters a trailing stop, or run with costs lower than your broker's, every run inherits that.
- It assumes the trades are independent. Real trades often aren't: losses cluster when the market changes character, so a real streak can run longer than a shuffle suggests.
- It breaks strategies whose trades belong together. A grid or martingale EA opens positions that only make sense as a basket, so shuffling single trades from it gives meaningless results. Our article on grid and martingale EA risks explains why those systems need judging on equity drawdown instead.
- It can't test markets that aren't in the data. If the backtest never saw a fast trend or a quiet range, no reordering will add one.
Monte Carlo and walk-forward answer different questions, so use both. A walk-forward optimization checks whether the settings hold up on data they weren't tuned on. Monte Carlo then takes the out-of-sample trades and shows how deep their drawdown could plausibly get. Run the Monte Carlo on the out-of-sample trades, not the optimised ones, or you'll be measuring the luck of the optimiser.
FAQ
How many Monte Carlo runs are enough?
1,000 runs gives a usable 95th percentile. 10,000 makes the tail steadier and costs nothing extra in Python. In the example above, five separate sets of 1,000 runs put the 95th percentile drawdown between 19R and 20R, while sets of only 100 runs put the 99th percentile anywhere from 21R to 28R.
Does MT5 have a Monte Carlo simulation?
Not as a feature of the Strategy Tester. Its random delay setting varies how long execution takes, which is useful, but it doesn't reorder or resample trades. Export the trade list and run the simulation in a spreadsheet, in Python or in a separate testing tool.
Is Monte Carlo better than walk-forward analysis?
Neither replaces the other. Walk-forward asks whether the settings work on unseen data. Monte Carlo asks how bad the drawdown could get with the trades you have. A strategy should pass walk-forward first, then go through Monte Carlo to set its risk.
Can a Monte Carlo simulation predict profits?
No. It only recombines past trades, so it can't see a market that behaves differently from the test period. Use it to plan for bad sequences of trades.
Keep reading: walk-forward optimization, drawdowns and losing streaks, risk of ruin in trading and the MT5 Strategy Tester guide.
Risk note: trading forex carries a high level of risk and may not be suitable for everyone. This article is for education only and is not financial advice.
Have a strategy you want automated?
We turn trading rules into tested Expert Advisors for MT4 and MT5. Tell us how you trade and we'll send a specification and a quote.
More articles

What is profit factor in trading? Formula and good values
How to calculate profit factor, how it links win rate and win size, what counts as a good value, four checks before you trust one, and where MT5 and MT4 show it.
Read article
ATR stop loss: how to set it and which multiplier to use
How an ATR stop loss works, how to read the ATR in MT5 and turn it into pips, which multiplier to start with, how to size the trade, and how to trail it.
Read article
Walk-forward optimization: how to run it in MT5
How walk-forward optimization works, how to pick the window lengths, how to run it window by window in MT5, and what the results can and cannot tell you.
Read article