VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Backtesting and validation

Monte Carlo position sizing: how many futures contracts per account?

Monte Carlo position sizing reshuffles a strategy's own closed trades thousands of times, reads the drawdown most reshuffled histories stay under (the 95th percentile), adds the margin each contract needs, and sets the contract count so both fit inside the share of the account you chose to risk before running.

By · Published · updated · Editorial policy

Contents
  1. How does Monte Carlo simulation decide contract count?
  2. Which trade list do you feed into the simulation?
  3. Why keep margin and tick value in the model?
  4. Which drawdown percentile should you use?
  5. How do you simulate the same trades at 1, 2 and 3 contracts?
  6. Can Monte Carlo calculate risk of ruin across trials?
  7. How do you turn the result into contracts per account size?
  8. Frequently asked questions
  9. References

How does Monte Carlo simulation decide contract count?

Monte Carlo position sizing reshuffles your strategy's own closed-trade list thousands of times, reads the maximum drawdown that most of those reshuffled histories stay under, adds the margin each open contract needs, and sets the contract count so that both fit inside the share of the account you decided to risk before you ran anything.

Monte Carlo simulation is a method that answers a question by running the same random process many times and counting the results, named by Metropolis and Ulam (1949). In trading, the random process is the order of your trades. Think of a deck of cards where each card is one closed trade. The sum of the deck is fixed, so the total profit does not change when you shuffle. What changes is how many losing cards you can turn over in a row. That run of losses is the drawdown, and it is the number that decides how many contracts an account can carry.

The chain has five steps. Take the closed trades after costs. Reshuffle their order a thousand times or more. Record the maximum drawdown of each reshuffled history. Read the drawdown that most trials stay under. Divide that figure, plus margin, into the part of the account you are willing to lose. The free Monte Carlo drawdown simulator runs the middle steps from a pasted trade list. For the reshuffle itself, start with what Monte Carlo simulation is, with a futures example; for the drawdown side, read why a Monte Carlo backtest usually shows a worse max drawdown than the original.

Five steps from one trade list to a contract count: take the closed trades after costs, reshuffle them a thousand times or more, record each trial's max drawdown, read the 95th percentile, and divide it into the account's risk share. The last step repeats for 1, 2 and 3 contracts. From trades to contracts Five steps, one trade list 1 Closed trades, after costs 2 Reshuffle thousands of times 3 Max drawdown of each trial 4 Read the 95th percentile 5 Divide into risk share Try 1, 2, 3 Shuffling moves drawdown, not profit. So: size to the deep runs.
From one trade list to a contract count. The loop at the end repeats the last step for 1, 2 and 3 contracts.

Which trade list do you feed into the simulation?

Feed in the closed trades of one real backtest, after commission and slippage, at one contract. The simulation can only rearrange what you give it. A trade list without costs produces a drawdown that is too shallow, and a list from a backtest with several contracts has to be divided back to one contract before the scaling in the later sections works.

The worked input for this article is a run from AlphaPrime (Valynox) on NQ daily bars from the start of 2019 to the end of June 2025, long and short, one contract. It uses an Average True Range rule as its only entry and exit, a stand-in built from a standard indicator, not a Monte Carlo rule itself. It is the one candidate the 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. Nothing here says the rule earned that money or that a reader can expect it; the list is used only as raw material for the reshuffle.

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

NumberResult
Net profit (closed trades)$233,415
Max drawdown$96,430
Trades172
Win rate59.3%
Profit factor1.52
Average trade$1,357.06
Time in market81.97%
The summary of the run whose 172 closed trades are the simulation input. Read the trade count and the max drawdown; both are used below.
The summary of the run whose 172 closed trades are the simulation input. Read the trade count and the max drawdown; both are used below. NQ · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest

The max drawdown of $96,430 in that table is one ordering of 172 trades, the ordering that the calendar happened to produce. Shuffle the same 172 trades and a different ordering gives a different drawdown. Some orderings cluster the losses and dig deeper; some spread them out and stay shallower. The single figure from the backtest is one point inside that spread, and there is no reason to expect it to be the deepest. The closed-trade list that feeds the reshuffle is the one AlphaPrime's Performance Report prints trade by trade, next to the drawdown that this one calendar order produced.

The spread of max drawdown across reshuffled orderings of the same trades. Find where the single backtest drawdown sits inside it, and how much of the spread lies to its right.
The spread of max drawdown across reshuffled orderings of the same trades. Find where the single backtest drawdown sits inside it, and how much of the spread lies to its right. NQ · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest

Two checks on the input before you shuffle. The trade count matters: 172 trades is a modest sample, and the reshuffle cannot invent trades that are not there, so a short list gives a narrow and over-confident spread. And the order of trades should not carry information the shuffle destroys: a strategy whose losses come in natural clusters, as trend rules often do in sideways markets, may see a real drawdown deeper than the shuffled ones. Bailey, Borwein, López de Prado and Zhu (2014) show why the best of many candidates carries an optimistic bias, which is one more reason to treat the kept run's own drawdown as a floor, not a ceiling.

Why keep margin and tick value in the model?

Keep both in, because the account carries the drawdown and the margin at the same time, and leaving either out makes the contract count look safer than it is. Tick value is the dollar amount one minimum price step of the contract is worth; it is what turns a point move on the chart into a dollar loss in the account. Maintenance margin is the money the exchange and broker require you to hold for every open contract; it is locked while the position is open and is not available to absorb losses.

For the E-mini Nasdaq-100 (NQ), CME Group lists a contract size of $20 times the index and a minimum tick of 0.25 index points worth $5.00, so one full index point is $20 per contract. A backtest that was built with the correct point value already reports trades in dollars, and the shuffle works on those dollars directly. Check that setting once before you trust the list; a backtest set to the wrong point value gives a drawdown that is wrong by the same factor. Exchanges can change tick size, point value and margin, so confirm them on the exchange's contract page; the free futures contract calculator shows tick value and point value side by side.

Hypothetical example

Suppose a reshuffled history puts the account 400 index points against you on one contract. At $20 per point that is $8,000 of drawdown. The same contract also needs, say, $20,000 of maintenance margin while it is open. The account must hold $28,000 to stay in the trade, not $8,000. If the margin figure is left out, the contract count comes out far too high.

Hypothetical example for one NQ contract: a 400-point adverse move at 20 dollars per point is eight thousand dollars of drawdown, maintenance margin adds twenty thousand dollars, so the account must hold twenty-eight thousand dollars; margin and tick value come from the exchange's contract page and can change. Hold drawdown plus margin One NQ contract, in $ thousands Drawdown 400 pts × $20 = 8 Margin 20 Needed 28 Hypothetical; check the exchange page Margin is locked; it absorbs no loss. So: size on drawdown plus margin.
Points become dollars through the tick value, then margin is added, and only the sum is compared with the account. Values are a hypothetical example; the exchange's contract page holds the current ones.

Margin is often the larger of the two blocks for an index future, which surprises traders who size only by drawdown. The sizing rule in the later sections treats one contract as a package: its share of the simulated drawdown plus its margin, both scaling together.

Which drawdown percentile should you use?

Size to the 95th percentile of the simulated maximum drawdown, not to the median and not to the single drawdown of the original backtest. A percentile is the value that a given share of the trials stay under; the 95th percentile is the drawdown that 95 of every 100 reshuffled histories did not exceed. Magdon-Ismail and Atiya (2004) show that the expected maximum drawdown grows with the length of the record, so the longer you plan to trade, the further to the right the real-life figure drifts; the 95th percentile builds in part of that drift.

Each candidate line has a clear reason to reject it:

Sizing lineWhat it isWhy it is or is not the right line
Median (50th percentile)Half the trials were deeperToo kind: you accept a coin flip on whether the real drawdown is worse
Original backtest drawdownOne ordering, the calendar'sNo special status; often sits near the middle of the spread
95th percentile19 of 20 trials stayed under itCovers most orderings and still leaves a tradeable contract count
Worst trialOne freak orderingMoves every time you rerun the shuffle and would leave you trading almost nothing
Hypothetical histogram of shuffled max drawdowns for one contract, not the NQ run: the median is twenty-eight thousand dollars, the 95th percentile of forty thousand dollars is highlighted as the sizing line, the worst trial is sixty-one thousand dollars, and a single backtest's drawdown is a dot near the median. Size to the 95th percentile Shuffled drawdowns, $k, hypothetical Median 28 95th 40 Worst 61 Backtest Size to the line 19 in 20 stay under. So: not the median, not the worst.
Where the median, the 95th percentile and the worst trial sit on the drawdown distribution. The 95th percentile is the sizing line; the single backtest drawdown is only a dot inside the spread.

The worst trial deserves one more word. It depends on how many trials you ran: a thousand shuffles produce a milder worst case than ten thousand, because more draws reach further into the tail. A sizing line that changes with the number of trials is not a line you can write down in advance. The 95th percentile settles quickly as trials increase, which is exactly what a pre-written rule needs.

How do you simulate the same trades at 1, 2 and 3 contracts?

Multiply every trade result by the contract count, and the 95th-percentile drawdown and the margin both scale in a straight line while the account stays the same size. Two contracts of the same rule produce exactly twice the dollar result of each trade, because entries and exits are at the same prices; the shuffle therefore does not need to be rerun. Scale the one-contract percentile and the one-contract margin, and compare each total with the fixed risk share of the account.

The risk share is the part of the account you decided, before running anything, that this strategy may lose in a deep drawdown while still holding its margin. It is your choice and should be written down in advance. An account that runs several strategies gives each one a smaller share.

Hypothetical example

Account $150,000. Risk share 60 percent, so $90,000 is the line. One contract: 95th-percentile drawdown $40,000 plus margin $20,000. The three contract counts compare as follows.

Contracts95th-percentile drawdownMarginTotal neededUnder the $90,000 line?
1$40,000$20,000$60,000Yes
2$80,000$40,000$120,000No
3$120,000$60,000$180,000No

Only one contract fits. The second contract alone would need the drawdown spread to be half as deep, or the account to be a third larger.

Hypothetical example: 95th-percentile drawdown plus margin is sixty thousand dollars at 1 contract, a hundred and twenty thousand at 2 and a hundred and eighty thousand at 3, against a fixed line at ninety thousand dollars, 60 percent of a hundred-and-fifty-thousand-dollar account; only the 1-contract bar stays under the line. Only one contract fits Drawdown + margin, $k, hypothetical 60% of account 1 contract 60 2 contracts 120 3 contracts 180 Drawdown (95th) Margin The need grows; the line stays put. So: trade the count under the line.
Drawdown plus margin grows in a straight line with the contract count; the account's risk share does not move. Hypothetical example.

Note what happens to the bars as the account grows. Doubling the account doubles the line but leaves the bars where they are, so the contract count rises in steps, not smoothly. This is why the last section rounds down to a whole contract rather than quoting a fraction.

Can Monte Carlo calculate risk of ruin across trials?

Yes: count the share of trials in which the account falls below a ruin line you wrote down before running, and that share is the risk of ruin for that contract count. Risk of ruin is the probability that the account loses a set fraction of its starting value before it recovers, usually a fraction at which you would stop trading the strategy. The ruin line is a loss level, not a drawdown percentile; it might be half the account, or whatever point at which you would stop.

  1. Write the ruin line down first. A line chosen after seeing the trials is a line fitted to the trials.
  2. Run the shuffle once at one contract and keep every trial's full equity path, not only its max drawdown.
  3. For each contract count, scale every path by the contract count and count the trials that cross the ruin line at any point.
  4. Divide by the number of trials. The result is the risk of ruin at that contract count.

The share rises steeply once contracts pass what the 95th-percentile drawdown allows. At one contract the ruin line sits far beyond the right tail of the drawdown spread, and almost no trial reaches it. Each extra contract stretches the spread by one more unit, and because the tail of a drawdown distribution is thin, a small stretch sweeps in a large share of trials at once. In the hypothetical figure below, the share is a fraction of one percent at one contract, a few percent at two, and about a fifth of all trials at three; the trader's pre-written limit of two percent is crossed between one and two contracts, the same boundary the drawdown comparison found.

Hypothetical example, ruin line at a 50 percent loss of the account: the share of trials that hit it is 0.2 percent at 1 contract, 3 percent at 2, 21 percent at 3 and 48 percent at 4; only 1 contract stays under the trader's pre-written limit of 2 percent. Ruin jumps past one contract Trials that hit a 50% loss, hypothetical Limit 2% 1 contract 0.2% 2 contracts 3% 3 contracts 21% 4 contracts 48% Past the limit, ruin climbs fast. So: fix the limit before the first run.
Risk of ruin by contract count, read from the reshuffled trials. The jump between two and three contracts is the thin tail being pulled across the ruin line. Hypothetical example.

The free risk of ruin calculator reaches a similar figure from a different direction, using win rate, payoff ratio and risk per trade instead of the trade list. When the two routes disagree widely, the trade list usually holds the explanation: a few very large losses that an average-based formula smooths away.

How do you turn the result into contracts per account size?

Divide the account's risk share by the sum of the 95th-percentile drawdown and the margin per contract, then round down to a whole number. The steps, in order:

  1. Export the closed-trade list of a one-contract backtest with commission and slippage included.
  2. Write down the risk share, the ruin line and the ruin limit before running anything.
  3. Reshuffle the list a thousand times or more and record each trial's max drawdown and equity path.
  4. Read the 95th-percentile max drawdown for one contract.
  5. Look up the current maintenance margin per contract on the exchange's contract page.
  6. Divide the risk share by (drawdown + margin) and round down.
  7. Check the risk of ruin at that contract count against your pre-written limit; if it fails, drop one contract.
  8. If the rule has a fixed stop, also take the count the free position size calculator gives from the stop distance and the account risk per trade, and trade the smaller of the two counts. The drawdown-based count protects the account across a run of losses; the stop-based count protects it on a single trade.

Hypothetical example

Using the numbers from the 1, 2, 3 contract section: $90,000 (60 percent of a $150,000 account) ÷ ($40,000 + $20,000) = 1.5. Round down: 1 contract. The risk-of-ruin check at 1 contract stays under the 2 percent limit, so 1 contract stands. The account would need to reach about $180,000 at the same risk share before the division reaches 2.

Hypothetical example: risk share divided by drawdown plus margin per contract gives 1.5, which falls inside the one-contract step and rounds down to 1 contract; the account must grow by about a fifth before the result reaches 2 and allows a second contract. One division, rounded down Risk share ÷ (drawdown + margin) Today: 1.5 Account +20% 1 contract 2 contracts 1 2 3 Round down to a whole contract. So: rerun when margin or trades change.
The one division that turns an account size into a whole contract count. Hypothetical example.

Rerun the division whenever the margin changes, whenever you add trades to the list, and whenever the account moves enough to cross a step. The margin and the trade list change the denominator; the account changes the numerator; the risk share should not change at all once written.

The one test to run next: take your own one-contract trade list, run it through the simulator, and write down two contract counts, one from the backtest's single max drawdown and one from the 95th percentile. If they differ by a whole contract, the single drawdown was hiding orderings that your account could not have carried. If you prefer to see every step of the shuffle, building the Monte Carlo simulation in Excel walks through it cell by cell.

Frequently asked questions

What is Monte Carlo position sizing?

Monte Carlo position sizing is a way of choosing how many contracts to trade by reshuffling a strategy's own closed trades many times and reading how deep the drawdown gets in most of the reshuffled histories. The contract count is then the largest number at which that drawdown, plus the margin for each contract, still fits inside the share of the account you decided to risk. It uses the trades you already have rather than a formula built from averages.

How many Monte Carlo trials do I need for position sizing?

A thousand reshuffles is enough for the 95th percentile to settle; more trials change it very little. The worst trial, by contrast, keeps getting worse as you add trials, which is one reason not to size to it. What limits accuracy more than the trial count is the number of real trades in the list: a short list gives a narrow, over-confident spread no matter how many times you shuffle it.

Should I size to the 95th or the 99th percentile of drawdown?

The 95th percentile is the usual choice because it is stable across reruns and leaves a contract count you can actually trade. The 99th percentile is closer to the worst trial, moves more between runs, and often cuts the contract count by a whole contract for little change in the risk of ruin. If you want extra protection, lower the risk share of the account instead of moving the percentile.

Does reshuffling the trades change the strategy's win rate or profit?

No. Every reshuffled history contains the same trades, so the total profit, the win rate, the profit factor and the average trade are identical in every trial. Only the order changes, and with it the deepest run of losses. That is why the method is useful for sizing and not for judging whether the strategy has an edge.

Can Monte Carlo calculate the risk of ruin for a futures strategy?

Yes. Write down a ruin line, such as a 50 percent loss of the account, before running. Then count how many reshuffled equity paths cross that line at any point and divide by the number of trials. Repeat for each contract count; the share rises sharply once the contract count exceeds what the 95th-percentile drawdown and margin allow.

References

  • Metropolis, N., & Ulam, S. (1949). The Monte Carlo Method. Journal of the American Statistical Association, 44(247), 335–341.
  • Magdon-Ismail, M., & Atiya, A. F. (2004). Maximum Drawdown. Risk, 17(10), 99–102.
  • 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.
  • CME Group. E-mini Nasdaq-100 Futures contract specifications (contract size $20 × index, minimum tick 0.25 index points = $5.00). cmegroup.com/markets/equities/nasdaq/e-mini-nasdaq-100.contractSpecs.html