Monte Carlo and Walk-Forward Testing: Stress-Testing a Strategy
How Monte Carlo simulation and walk-forward analysis help estimate the range of outcomes of a strategy, the drawdowns you should expect and whether the rules hold on new data.

Key takeaways
- Monte Carlo shows the range of possible drawdowns.
- Walk-forward tests rules on unseen data.
- Both depend on realistic inputs.
- Use them as a gate before going live.
Why one backtest is not enough
A backtest gives one path through history. The same trades in a different order could have produced a much deeper drawdown. Monte Carlo and walk-forward methods help you see the range of possible outcomes and test whether the rules adapt to new data.
Monte Carlo simulation
Take your list of historical trade results and randomly reshuffle them thousands of times, building many alternative equity curves. Look at the distribution: the median result, the worst 5% of drawdowns and the chance of hitting a loss limit. If the worst-case drawdowns are far worse than the historical one, plan for them. This also helps estimate risk of ruin.
What Monte Carlo cannot do
It assumes the future trades resemble the past and are independent of each other. It cannot fix a flawed backtest or predict regime changes. Treat it as a way to understand variance, not a prediction.
Walk-forward analysis
Divide history into consecutive windows. Optimise the parameters on the first window (in-sample), then apply them unchanged to the next window (out-of-sample), record the results, move forward and repeat. Stitching together the out-of-sample segments gives a more honest picture than a single optimisation over all data. If the out-of-sample results stay positive, confidence rises.
How to use the results
- Set position size so that a bad but plausible drawdown from the simulation is survivable.
- Check that walk-forward results are not much worse than in-sample ones.
- Use them as a gate: a strategy that fails them does not go live.
Limits and next steps
All simulations are only as good as their inputs: realistic costs, enough trades and clean data. After testing, paper trade the strategy and compare real results with the simulated range. Read strategy robustness for related checks.
A Monte Carlo example (illustrative)
Suppose a strategy produced 300 historical trades with an average of +0.2R, a win rate of 42% and a maximum historical drawdown of 9R. You reshuffle the trades 5,000 times and record the maximum drawdown in each run. You might find that the median maximum drawdown is 11R, the 95th percentile is 18R and in 2% of runs the drawdown exceeds 25R. The historical 9R was therefore a favourable ordering. If your risk is 1% per trade, an 18R drawdown means roughly 18% of the account, which you should be prepared for. The numbers are invented, but the lesson is real: the single backtest path usually understates the drawdowns you might face.
A walk-forward example (illustrative)
With ten years of data, divide into four-year optimisation windows and one-year test windows. Optimise on years 1 to 4 and test on year 5; then optimise on years 2 to 5 and test on year 6, and so on, giving six out-of-sample years. If the strategy earns money in five of the six test years with a drawdown similar to the in-sample one, you have more confidence. If the test years are mostly negative while in-sample results are strong, the rules are overfitted. Keep the same procedure for choosing parameters in each window and do not change it after seeing the results. Learn more about the traps in backtesting mistakes and the checks in strategy robustness.
What to do next
If you have a list of at least 100 trade results from a backtest or a live account, copy it into a spreadsheet and build a simple Monte Carlo: shuffle the order of the trades with random numbers, compute the maximum drawdown for each shuffle, repeat a few hundred times and read off the median and the worst five percent. Compare the result with your historical drawdown and your risk per trade. If the bad-case drawdown would be too painful, reduce the size. Then try a basic walk-forward split of your data in two halves to see whether the second half confirms the first.
Try it yourself — free tools
Frequently asked questions
What is Monte Carlo testing in trading?
Randomly reshuffling or resampling historical trades many times to estimate the range of possible results and drawdowns.
What is walk-forward testing?
Repeatedly optimising on one period and testing on the next, to check whether the rules work on unseen data.
How many trades do I need?
The more the better; a few dozen trades give very rough estimates, and hundreds give more reliable ones.



