VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Backtesting and validation

What is Monte Carlo simulation? A futures trading example

Monte Carlo simulation repeats one calculation many times with random inputs and reads the whole range of outcomes. For a futures trader the inputs are the backtest's own trades: shuffle their order many times and the one drawdown in the report becomes a range of drawdowns to plan account size for.

By · Published · updated · Editorial policy

Contents
  1. What is Monte Carlo simulation?
  2. How does a Monte Carlo simulation work on a list of trades?
  3. A small worked example: ten trades, one thousand shuffles
  4. What does a Monte Carlo simulation tell you, and what does it not?
  5. When should you run it in a research workflow?
  6. Frequently asked questions
  7. References

What is Monte Carlo simulation?

Monte Carlo simulation is a method that repeats one calculation many times with random inputs and reads the whole range of results, not one number. For a futures trader the inputs are the strategy's own trades, and the backtest equity curve is only one of many orders those trades could have come in.

Think of a deck of cards. The cards in the deck are fixed, but each shuffle changes which card comes first. A trade list is the same: the backtest gives you a fixed set of wins and losses, but the order they arrived in was partly luck. Maximum drawdown is the largest fall from an equity peak to the following low before a new peak, and it depends heavily on that order. Three losses spread across a year make a shallow dip; the same three losses in a row make a deep one. You can measure the drawdown of any equity series with the free drawdown calculator; Monte Carlo asks what that number would have been in other orders.

The Monte Carlo method is used the same way in engineering and finance: when a single answer hides a spread of possibilities, you draw random inputs many times and look at the spread. In trading the version most people mean is trade-order Monte Carlo, which this article explains.

Illustration: one backtest equity curve rises to the same end point with a dip of 3 units, while the same trades reshuffled into other orders form a band of curves that all end at the same place, the worst with a dip of 7 units One curve, one of many orders Illustration: same trades, same end As it happened Other orders Dip −3 Dip −7 Same trades hid a deeper dip. So: plan for the worst of the band.
One backtest curve is a single path. The same trades in other orders end at the same place but form a band, and the band's dips are the drawdowns the single curve hid.

How does a Monte Carlo simulation work on a list of trades?

A trade-order Monte Carlo keeps every trade result and changes only the sequence, so the only thing it measures is how much the sequence moved the drawdown. The loop is short:

  1. Take the closed-trade list from the backtest: one profit or loss per trade, after commission and slippage.
  2. Shuffle the order. A plain shuffle uses each trade once. Redrawing with replacement picks trades at random and may pick the same one twice; this is the bootstrap method, and it also varies which trades appear, not only their order.
  3. Rebuild the equity curve from the new sequence.
  4. Record the maximum drawdown and the end result of that curve.
  5. Repeat one thousand to 10,000 times and collect the recorded drawdowns into a distribution.

A distribution is the full set of recorded drawdowns, usually drawn as a histogram: how many runs ended with a drawdown in each size bucket. The original backtest drawdown is one value somewhere inside it. The whole loop fits in a spreadsheet; the Monte Carlo simulation in Excel guide builds it column by column.

Shuffle, rebuild, repeat: the same ten hypothetical trades, shown as wins up and losses down, give a drawdown of 600 dollars in the backtest order, 900 dollars in one shuffled order and 400 dollars in another, and the drawdowns from many shuffles are collected into a histogram Shuffle, rebuild, repeat Same trades, three orders Win Loss Backtest Shuffle Shuffle $600 $900 $400 Drawdowns Each order gives a new drawdown. So: plan from the whole histogram.
The five repeated steps of a trade-order Monte Carlo. The histogram at the end is the distribution of drawdowns.

A small worked example: ten trades, one thousand shuffles

The same ten trades can produce a drawdown more than twice the original one, which is why the planning number comes from the distribution and not from the backtest. Round numbers make this visible.

Hypothetical example

A strategy closed ten trades, in this order: +$400, −$300, −$300, +$500, +$600, −$200, +$300, −$400, +$500, −$200. The net result is +$900 and the drawdown in this order is $600 (the two losses after the first win). The five losses add up to $1,400, so if all of them arrived in a row the drawdown would be $1,400 with the same net result. Suppose one thousand shuffles give a histogram that peaks near $800, and that 95 out of every 100 shuffles stay under $1,200. That $1,200 is the 95th percentile, and it is the drawdown to size the account for. The original $600 was a lucky order.

Hypothetical example: a histogram of maximum drawdowns from a thousand shuffles of ten trades peaks near 800 dollars; the original backtest drawdown of 600 dollars sits low in it, and the 95th percentile at twice that amount is the number to size the account for Plan for the 95th percentile Drawdown of each shuffle Hypothetical Backtest $600 95th: 2× backtest Worst 5% Max drawdown → The $600 backtest was a lucky order. So: size for twice the backtest.
Hypothetical example: the original drawdown sits inside a distribution, and the planning number is a high percentile of that distribution, not the original.

A real trade list looks like the run below from AlphaPrime (Valynox). It tested a MACD rule as the only entry and exit, no stop, target or filter, on ES daily bars from 2019-01-02 to 2025-06-30, long and short, one contract. The MACD rule is a stand-in built from a standard indicator; it is not the subject of this article. The run is the one candidate a search kept out of 1,024 it tried, chosen for its return against its drawdown, and picking the kept one after the fact flatters its numbers. Its 169 closed trades are the input you would shuffle, and $22,175 is the drawdown in the order that actually happened.

Source: AlphaPrime product engine (CPU), run 2026-10-31. ES daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $25 slippage per trade.

NumberResult
Net profit (closed trades)$69,220
Max drawdown$22,175
Trades169
Win rate50.89%
Profit factor1.46
Average trade$409.59
Time in market16.23%

Shuffling those 169 trades would show whether $22,175 sits in the middle of the drawdown distribution or in its lucky tail. Nothing about the shuffle changes the fact that the rule was selected after the fact, so the net profit is a description of the past, not something a reader can expect.

What does a Monte Carlo simulation tell you, and what does it not?

Monte Carlo rearranges the evidence in a trade list; it never adds evidence. That one sentence separates the questions it answers from the questions it cannot.

QuestionTrade-order Monte Carlo
How wide is the range of drawdowns from trade order alone?Answers it
Was the backtest drawdown typical or lucky?Answers it
What account size covers a chosen drawdown percentile?Answers it
How likely is a losing stretch of a given length?Answers it
Are the rules overfitted to the history?Does not answer
Did testing 1,024 variants inflate the kept candidate?Does not answer
Will future trades resemble the past?Does not answer
Were costs and fills modelled correctly?Does not answer

The second group matters because it is where most backtests go wrong. Selection bias from testing many variants and keeping the best is documented by Bailey and colleagues (2014); an inflated trade list stays inflated no matter how often you shuffle it. Why the best backtest is usually inflated covers that problem, and what a Monte Carlo backtest shows and does not show goes deeper into the limits listed here.

Trade-order Monte Carlo reorders evidence but adds none: it sees only the order of the trade list, so it answers drawdowns, luck, sizing and losing streaks, but it cannot see how the list was made, such as overfitting, selection bias, costs and fills, or what the next trades will be Reorders evidence, adds none Monte Carlo sees only the order Before Order After Not seen Seen Not seen Overfitting Selection bias Costs, fills Drawdowns Luck Sizing Streaks Next trades
The questions trade-order Monte Carlo can answer, against the questions it cannot.

When should you run it in a research workflow?

Run Monte Carlo after costs and validation, and before you choose account size, because it only interprets the trades it is given. The order of the whole workflow is:

  1. Backtest with commission and slippage included, so every trade in the list is a net trade.
  2. Validate. The walk-forward step in AlphaPrime's strategy validation produces the out-of-sample trades, and those, not the in-sample ones, are the list worth shuffling.
  3. Run Monte Carlo on that out-of-sample trade list and read the 95th percentile drawdown.
  4. Choose account size and contract count from that percentile; the free position size calculator turns a risk amount and stop distance into contracts.
  5. Export the strategy to the trading platform.

The method does not care what the trades were in. A futures trade list, a stock list and an ETF list all shuffle the same way; the backtesting guide for Taiwan stocks and ETFs shows a 0050 example whose trade list fits the same loop.

Research workflow in five steps: backtest with costs, validate out of sample, run Monte Carlo on the out-of-sample trades from step 2, size the position from the drawdown percentile, export the strategy Shuffle validated trades Where Monte Carlo fits 1 Backtest with costs 2 Validate out of sample 3 Monte Carlo 4 Size from percentile 5 Export strategy Input: OOS trades from step 2
Monte Carlo belongs after costs and validation and before position sizing, because it only interprets the trades it is given.

Your next step: take the closed-trade list from your last backtest, shuffle it one thousand times, and compare the 95th percentile drawdown with the account size you had planned. If the percentile is larger than the drawdown you were prepared to sit through, reduce the contract count before anything else.

Frequently asked questions

What is a Monte Carlo simulation in simple terms?

It is a way of answering a question by running the same calculation many times with random inputs and looking at the spread of answers. In trading, the random input is the order of your backtest trades. The spread of drawdowns across many shuffles tells you how much of the single backtest drawdown was luck of sequence.

What is Monte Carlo analysis in trading?

Monte Carlo analysis is the reading of the results after the simulation runs: the histogram of drawdowns, the percentile you plan for, and how the original backtest compares with it. The simulation produces the distribution; the analysis turns it into an account size and a contract count.

How many Monte Carlo runs are enough?

One thousand shuffles gives a stable picture of the middle of the distribution for most trade lists. The tails, such as the 95th or 99th percentile, settle more slowly, so several thousand runs are common when the percentile decides account size. The runs are cheap, so repeat the whole simulation twice and check that the percentile barely moves.

Does Monte Carlo simulation predict future returns?

No. It rearranges the trades a strategy already produced and shows the range of drawdowns those trades could have formed. It cannot know whether future trades will look like past ones, and it cannot repair a trade list that was inflated by testing many variants and keeping the best.

References

  • Efron, B. (1979). Bootstrap Methods: Another Look at the Jackknife. The Annals of Statistics, 7(1), 1–26.
  • Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.
  • Magdon-Ismail, M., & Atiya, A. F. (2004). Maximum Drawdown. Risk, 17(10), 99–102.