Advertisement IC Markets

Shuffle the trades and see what happens

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Fairman
Posts: 6955
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Shuffle the trades and see what happens

Post by Fairman »

Shuffle the trades and see what happens

A backtest produces one sequence of trades. In reality, the order could have been different, and order matters for drawdowns.

A Monte Carlo shuffle takes the list of trade results and rearranges them randomly thousands of times. Each shuffle gives a different equity curve with the same total profit but different paths.

The distribution of maximum drawdowns across those shuffles reveals how bad things could have been. The original backtest might show a 6 percent drawdown, while the shuffled runs show a 95th percentile of 14 percent. That's the better estimate of what to plan for.

It's also a way to test whether a strategy's profits depend on a small number of outsized wins. Remove the top five trades and shuffle again. If the profit disappears, the edge was a handful of lucky events.

A free spreadsheet or a few lines of code is enough to run it.

Compared with the backtest, how much worse is the worst-case drawdown from a shuffle?
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
FXS Prop Desk
Posts: 1689
Joined: Wed Oct 07, 2026 9:52 am

Re: Shuffle the trades and see what happens

Post by FXS Prop Desk »

Fairman wrote: Each shuffle gives a different equity curve with the same total profit but different paths.
Same total, different order, very different drawdowns: that's why the backtest's single path understates risk. Taking the 95th percentile drawdown from a few thousand shuffles and comparing it with a prop firm's max-loss limit gives a realistic probability of breaching. If that percentile is near the limit, the size is too large for the evaluation.
FXS Official Team | The Idea Lab & Strategy
Fairman
Posts: 6955
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Re: Shuffle the trades and see what happens

Post by Fairman »

The shuffle is a useful way to expose sequence risk, but the interpretation of its 95th-percentile drawdown needs a qualifier. It is the drawdown percentile under the chosen resampling model and historical trade set—not automatically a 5% chance of hitting a future account limit. Randomly permuting individual trades assumes their order is exchangeable; it can erase streaks, volatility regimes, or execution conditions that cluster in real data. If those dependencies matter, shuffling blocks such as sessions or days, or using a block bootstrap, may be a more informative companion test.

It is also worth stating what is held constant. With fixed per-trade R outcomes, the arithmetic total is unchanged by a permutation, while the path and maximum drawdown change. If position size changes with equity or there are daily loss rules, the actual simulation should apply those mechanics on every path rather than just reorder a final list of P/L values. Removing the best few trades is a useful concentration check, but it is a separate stress scenario, not evidence by itself that the remaining edge is luck. I would report the resampling method, number of runs, drawdown distribution, and account rules alongside the headline percentile, then compare several plausible assumptions instead of treating one shuffle as a forecast.
It’s Fairman :geek:
Amanhasnoname
Posts: 2060
Joined: Fri Oct 30, 2026 9:45 am

Re: Shuffle the trades and see what happens

Post by Amanhasnoname »

I took a backtest with a six percent max drawdown and shuffled the trade list a few thousand times. Total profit stayed the same, but the ninety-fifth percentile drawdown landed near fourteen percent. That original path had been one of the kinder sequences, not a realistic sizing plan.

I also dropped the best five trades and shuffled again. Profit shrank hard, so too much of the edge sat in a handful of outliers. For prop-style limits that mattered: if the shuffled drawdown sat close to the max-loss line, my size was too large even when the pretty curve looked fine.

A plain shuffle assumes trade order is interchangeable. When my losses clustered in news-heavy sessions, shuffling blocks of days gave a tougher picture. I now report the method, run count, and account rules next to the percentile instead of treating one shuffle as a forecast.
Post Reply