Monte Carlo simulation in trading: what it shows

By Oalgo · Last reviewed

A Monte Carlo simulation reshuffles and resamples the trades from a backtest many times. It shows a range of possible paths and drawdowns instead of one line. It does not predict which path will happen.

Chart: one made-up set of 12 trades. A gold line shows the account after each trade in the order the trades happened. Twenty fainter lines show the same trades in random orders. All lines start at the same point and end at the same point, but the paths between them differ.Your trades in orderSame trades, reshuffledStartEnd: thesame inevery path036912Trade number
Made-up trades, reshuffled. Not a test result.

How does a Monte Carlo simulation work?

#
  • Take the trades from a finished backtest.
  • Reshuffle: put the same trades in a new random order, many times. The end point never changes, because the same trades add up to the same total. The path does, and so does the largest fall.
  • Resample: build new lists by drawing short runs of trades from the original list, with repeats. Some trades appear twice and some not at all, so the end point changes too.
  • Measure every path: its largest fall (drawdown), its win rate and its longest stretch below an earlier high.
  • Line the paths up and read the range.

What does a worked example show?

#

Twelve made-up trades, in money units, on an account that starts at 1,000: +30, −20, +25, −15, +40, −10, +20, −35, +15, +30, −25, +20. In the order they happened the account ends at 1,075 and its largest fall is 35, from 1,070 to 1,035. Then the simulation reshuffles the same twelve trades 2,000 times.

MeasureIn the real orderIn 2,000 reshuffles
Account at the end1,0751,075 every time
Largest fall35Smallest 35, middle 55, largest 105
Reshuffles with a deeper fall than the real orderNot applicableAbout 83 in every 100

Same trades, same end point. Only the order changed, and with it how far the account fell on the way. No reshuffle had a smaller fall than the real order, so one backtest shows only one of many possible paths.

How does Oalgo show it?

#

In Oalgo, the Analytics tab of a finished backtest or forward test has a Monte Carlo card with a Run Monte Carlo button. It needs at least 30 trades and marks runs with fewer than 100 as Low confidence. A table compares your run with the simulated paths at the low end, in the middle and at the high end, and a tag says whether your order was lucky or unlucky. The card says it is built from your past trades and is not a forecast.

What can a Monte Carlo simulation not tell you?

#
  • It only mixes the trades you already have. If the backtest was tuned to the past (overfitting), every path is too.
  • Reshuffling treats each trade as independent. Real trades often come in streaks that depend on the market.
  • Few trades give a rough range (see how many trades you need).
  • It does not say which path will happen, or what prices will do next.

Read next