Monte Carlo Validation for EAs: What It Measures, With Real Data
A backtest shows a single path: the trades in the exact order they happened. But that order is largely chance. A Monte Carlo simulation builds thousands of alternative paths from the same trades to answer two questions: what drawdown is reasonable to expect, and how much of the result depends on luck?
Two different techniques
| Shuffling (permutation) | Resampling (bootstrap) | |
|---|---|---|
| What it does | Reorders the same trades | Draws trades at random, with replacement |
| Final result | Always the same | Changes in every run |
| What it is for | Estimating possible drawdowns and streaks | Estimating result uncertainty and the probability of profit |
How to do it with an MT5 EA
- Export the trade list from a period the EA did not see during optimisation (out of sample) or from a forward demo.
- Convert each result to R: profit divided by initial risk. That way you simulate at the fixed risk per trade you will actually use.
- Generate at least 1,000 paths (preferably 10,000) with a spreadsheet or a script, and compute each path's maximum drawdown and final result.
- Read the percentiles: the median tells you what is typical; the 95th or 99th, what you must be able to withstand.
An example with real trades
We applied it to the 242 non-duplicated trades of our $50,000 prop firm evaluation, simulating a fixed 0.5% risk per trade and 10,000 paths:
| Measure | Result |
|---|---|
| Maximum drawdown in the actual order | 12.8% |
| Drawdown with shuffled order: median / P95 / P99 | 11.8% / 14.2% / 15.4% |
| Final result with resampling: P5 / median / P95 | −18.2% / −10.1% / −1.3% |
| Resampled paths ending positive | 3% |
The reading is clear: with this trade list, the loss is not bad luck in the ordering. Shuffled, the drawdown barely changes because the curve falls almost continuously; resampled, only 3 in 100 paths end positive. Monte Carlo does not "rescue" a system without an edge: it confirms it. That is exactly its job.
Our own simulation from that account's MT5 report, at a hypothetical fixed risk of 0.5% per trade; the real account traded different sizes.
How to use the results
- Size risk on the P95 or P99 drawdown, not the backtest's. If P99 is 15% at 0.5% per trade and your limit is 10%, you must lower the risk.
- If fewer than 80–90% of resampled paths end positive, the edge is doubtful with that sample.
- Compare the P99 losing streak with what you can sit through without touching the EA.
What Monte Carlo cannot do
It only recombines the past. It does not know whether the market will change regime, it does not fix overfitting (if you use the trades you optimised on, every path will be too good), and it assumes trades are independent, which is false when several EAs repeat the same entry: that is why you should count signals, not trades. Always complement it with forward testing.
Frequently asked questions
How many simulations are needed?
1,000 show the main percentiles; with 10,000 the extremes (99th percentile) are stable. More does not change the conclusion.
Can Monte Carlo save an EA with negative expectancy?
No. It measures the spread of possible outcomes; with negative expectancy, almost every simulated path ends in a loss.
Which trades should I use?
Out-of-sample trades or, better, a forward demo. Using the same trades the EA was optimised on inflates the result.