Home › Documentation › Validation & robustness
Analysis 4

Monte Carlo Simulation

Available in the Monte Carlo tab of the Strategy Performance Report. It answers: how much did your curve depend on the ORDER in which the trades happened? The final profit is the same in any order (adding the profits in a different sequence gives the same total), but the drawdown does change. The test measures whether the drawdown you suffered was lucky or typical compared with other sequences of those same trades.

The principle

A strategy with 200 trades suffered its losing streaks in one particular order — possibly a lucky one. Monte Carlo takes the same 200 trades with their real profits and shuffles them at random 300 times, recomputing the equity curve each time. The end point always matches (the sum does not depend on the order), but the path —and above all the maximum drawdown— changes with every shuffle. That way you see the range of drawdowns you could have suffered with those same trades, and where yours fell.

What it shows
  • → The real equity curve (cyan line)
  • → The p25–p75 band of the shuffled orders
  • → The p5–p95 band (the possible paths; they converge at the end)
  • → The median of the 300 simulations
  • →Real drawdown vs the worst case (p95)
  • →A color-coded rating: % of orders with a worse drawdown
How to read it
> 80% → SOLID (robust drawdown)
Your real drawdown is better (smaller) than that of the vast majority of shuffled orders. The curve holds up well even if the trade sequence changes.
40–80% → ACCEPTABLE
A middling drawdown against reordering: typical behavior. Look at the worst case (p95) to size the real risk.
< 40% → WARNING SIGN
Your real drawdown is among the worst of all possible orders: the curve depended heavily on the sequence. Expect deeper falls than the historical one.

The technique: Fisher-Yates shuffle

Each simulation reorders the trades using the Fisher-Yates algorithm: a completely random, unbiased permutation in which every possible ordering is equally likely.

// For each simulation j:
for i := N-1 downto 1 do
  k := Random(i+1)
  Swap(Trades[i], Trades[k])
// Recompute cumulative equity

Performance

With 300 simulations and hundreds of trades, the whole calculation (shuffle + equity + drawdown + percentiles) takes a few tens of milliseconds — it runs on the front end (JS) with no visible freeze.

300
simulations
< 50 ms
compute time

It is computed when the Monte Carlo tab is shown (and when the window is resized). The grade buttons do not recompute anything.

Try it yourself

AniQuant can be tried free for 30 days, with every module and no card.

← Previous
Parameter robustness test
Next →
Survival test
More in Validation & robustness