Skip to main content
Backtesting & Validation

Monte Carlo Analysis for Trading Strategies, Explained Simply

What Monte Carlo analysis is, why one backtest equity curve misleads, and how trade shuffling reveals realistic drawdowns — explained for Indian algo traders.

CandleAI Research Team 8 min read

You run a backtest on five years of NSE data. The equity curve climbs steadily, maximum drawdown is a comfortable 12%, and you start wondering how much capital to deploy. Here is the uncomfortable truth: that equity curve is one possible version of history, and your live results will almost certainly look different — sometimes much worse — even if the strategy itself is genuinely sound.

Monte Carlo analysis is the tool that tells you how much worse things could plausibly get. It is one of the most valuable and least used steps in the retail algo trader’s workflow, mostly because it sounds intimidating. It isn’t. This article explains it in plain English.

What is Monte Carlo analysis?

Monte Carlo analysis is a technique that re-runs your strategy’s trade results thousands of times in randomized orders (or random samples) to produce a distribution of possible outcomes instead of a single equity curve. Rather than asking “what did this strategy do?”, it asks “what is the range of things this strategy could realistically do?”

The name comes from the Monte Carlo casino — a nod to the role of randomness — and the method is used everywhere from physics to project planning. In trading, it answers three questions a single backtest cannot:

  1. How deep could my drawdown realistically get?
  2. What is the chance this strategy wipes out an unacceptable share of my capital?
  3. How confident can I be in the returns the backtest showed?

Why a single backtest is just one ordering of trades

Think of your backtest as a deck of cards. Each card is one trade: some winners, some losers. The backtest dealt those cards in one specific historical order — the order the market happened to produce.

But the order of trades is largely luck. A strategy with a real edge would still have produced a different sequence if a few signals had fired a day earlier, if one gap-up had gone the other way, or if you had started trading it three months later. Same edge, same win rate, same average win and loss — different ordering.

And ordering is what determines drawdown. Ten losing trades spread evenly across a year feel very different from ten losing trades in a row. Your backtest showed you one shuffle of the deck. Monte Carlo shows you thousands.

This matters enormously for Indian retail traders because most of us size positions off the backtest’s maximum drawdown. If the backtest showed −12% and you sized capital assuming −15% “to be safe”, but the distribution of drawdowns puts −25% well within normal variation, you are one bad sequence away from abandoning a working strategy — or blowing through a margin buffer on an F&O book.

How Monte Carlo works for trading, step by step

There are two common flavours. Both start from the list of individual trade results your backtest produced (e.g. +₹1,800, −₹950, +₹2,100, …).

Method 1: Trade-order shuffling

  1. Take every trade from the backtest.
  2. Shuffle them into a random order — same trades, new sequence.
  3. Rebuild the equity curve from that sequence and record its CAGR, max drawdown and final equity.
  4. Repeat thousands of times (5,000–10,000 runs is typical).
  5. Plot the distribution of each metric across all runs.

Shuffling keeps every trade exactly as it happened; only the order changes. It directly answers: “How much of my drawdown figure was luck of sequencing?”

Method 2: Resampling with replacement (bootstrapping)

  1. Take the same list of trades.
  2. Build a new sequence by drawing trades at random, with replacement — the same trade can appear twice, or not at all.
  3. Rebuild the equity curve and record the metrics.
  4. Repeat thousands of times.
  5. Plot the distributions.

Resampling is harsher. Because a simulated run can draw the worst losing trade three times, it explores sequences worse than anything in the original backtest — closer to what live trading can serve up.

Trade-order shufflingResampling with replacement
Uses each tradeExactly onceZero or more times
Can produce runs worse than the backtestOnly via orderingYes, via ordering and composition
Best forIsolating sequence riskStress-testing the edge itself
AssumptionTrade results are independent of orderTrades are draws from a stable distribution

Good practice is to run both. If your strategy only looks acceptable under the gentler shuffle, that is a warning.

Reading the outputs

A Monte Carlo report typically gives you three things:

Distribution of maximum drawdown. Instead of one number (−12%), you get a spread: perhaps the median run draws down −14%, the 95th percentile run −22%, and the worst runs −30%. The 95th percentile is the number to plan around — it says “19 times out of 20, drawdown stayed inside this.”

Probability of ruin. Define “ruin” as a loss you would never tolerate — say −40% of trading capital — and the simulation reports what fraction of runs ever breached it. A strategy can have a positive expectancy and an unacceptable probability of ruin at your position size. This is the single most decision-relevant number Monte Carlo produces.

Confidence intervals on CAGR. The backtest said 24% CAGR; the simulation might say the middle 90% of runs landed between 9% and 31%. If the lower bound is near zero or negative, the strategy’s edge is too thin to distinguish from luck over your test window.

A worked example: the deceptive 55% win-rate strategy

Suppose you backtest an intraday NIFTY strategy over three years. It takes around 400 trades, wins 55% of them, and average win roughly equals average loss. The backtest equity curve shows a maximum drawdown of −11%. Encouraging.

Now shuffle those 400 trades 10,000 times. With a 55% win rate, streaks of 7–9 consecutive losses are not rare events across 400 trades — they are expected somewhere in the sequence. In many reshuffles, one of those streaks lands right after another cluster of losses, and the simulated drawdown reaches −18% to −24%. A handful of runs go deeper still.

Nothing about the strategy changed. Its edge, win rate and trade sizes are identical in every run. The only thing that changed is the order — and the order alone nearly doubled the realistic worst-case drawdown. A trader who sized capital for −12% would have hit their pain threshold and quit in a large share of the simulated futures, abandoning a strategy that was working exactly as designed.

That is the core lesson: the backtest showed you a lucky shuffle, and you cannot know in advance whether live trading will deal you a lucky one too.

Using the results: capital sizing and kill switches

Monte Carlo output is only useful if it changes what you do. Three practical applications:

  1. Size capital off the 95th-percentile drawdown, not the backtest drawdown. If the 95th percentile is −22% and your personal tolerance is losing no more than ₹1,00,000, your allocation to this strategy should be sized so that a −22% drawdown costs about that much — not more.
  2. Set your kill switch beyond normal variation, not inside it. A max-loss kill switch at −12% would trip constantly on a strategy whose normal drawdown range extends to −20%. Place the disable threshold past the 95th–99th percentile band, so that tripping it genuinely signals “something is broken”, not “normal bad luck”. Our risk management guide for algo trading covers where these thresholds belong in a full risk stack.
  3. Reject strategies whose lower confidence bound is unacceptable. If the 5th-percentile CAGR is negative, more backtesting polish will not fix it — you need more trades, a stronger edge, or a different idea. It is far cheaper to learn this before deployment than after; see Backtesting vs Paper Trading for where each validation stage fits.

Running Monte Carlo without writing a line of code

Doing this yourself in Python is a genuine project: exporting trades, writing the resampling loops, computing percentile statistics, plotting distributions. That effort is why most retail traders skip the step entirely.

CandleAI builds it into the workflow: after any backtest on NSE data, one click runs a Monte Carlo simulation over the strategy’s trades and reports the drawdown distribution, confidence bands on returns and probability of breaching your loss limits — alongside the walk-forward and paper trading tools covered in our platform selection guide. Whether you built the strategy with the AI builder or the visual editor, validation is part of the same pipeline, not a separate coding exercise. You can start free and run Monte Carlo on your first backtest today.

Common misconceptions

“Monte Carlo predicts the future.” No. It maps the range of outcomes consistent with your historical trades. If the market regime changes or the backtest was curve-fit, the simulation inherits those flaws. It widens your view of the past; it does not forecast.

“More simulations mean better results.” Beyond a few thousand runs, the distributions stabilize. 10,000 runs is not more “accurate” about the future than 5,000 — the limiting factor is the quality and quantity of the underlying trades.

“A strategy that survives Monte Carlo is safe to deploy.” It is safer to size, which is different. Monte Carlo says nothing about slippage, liquidity, or broker outages. Paper trading remains a separate, necessary step.

“Monte Carlo is only for large portfolios.” The opposite. Small accounts have the least room for an unexpected −25% drawdown, so understanding the drawdown distribution matters more when capital is limited.

FAQ

How many trades do I need before Monte Carlo is meaningful? There is no magic number, but distributions built from very few trades (say, under 30–50) are dominated by noise. If your backtest produced only a handful of trades, generate more history or accept that every statistic — Monte Carlo included — is tentative.

Should I use shuffling or resampling? Run both. Shuffling isolates sequence risk; resampling with replacement stress-tests the edge by creating compositions worse than history. If the strategy only passes the gentler test, treat that as a caution flag.

Does Monte Carlo replace walk-forward analysis? No — they answer different questions. Walk-forward tests whether your parameters hold up on unseen data; Monte Carlo tests how much your results depend on trade ordering. A robust validation process uses both, which is why platforms like CandleAI run them side by side after a backtest.

Can Monte Carlo be applied to options strategies on NSE? Yes — the method operates on trade results, so it works for equity, futures or options strategies alike. Just remember that option trade distributions often have rare large losses, which makes resampling with replacement especially important there.


Trading in securities involves risk of loss. Nothing in this article is investment advice; it is educational content. Always test strategies thoroughly before deploying real capital.

Put this into practice

Build and backtest your own strategy free — no coding, no card.

Start free