What the Monte Carlo trading simulator does
A backtest gives you one equity curve: the trades in the order they happened. The same edge over a different stretch of market would have produced a different curve, with different drawdowns. A Monte Carlo simulation replays your strategy thousands of times with randomly drawn wins and losses to show the range of outcomes your numbers allow: the median result, a bad run and a good run, how deep drawdowns typically get, and how often they cross a threshold you choose.
How to use it
- Enter your starting balance and your risk per trade in percent. The risk is recalculated on the current balance after every trade (fixed-fractional sizing).
- Enter your win rate and your average win and average loss in R. A trade stopped out is −1R; a target at twice the stop distance is +2R. If some losses are closed before the stop, an average loss below 1R is fine.
- Enter the number of trades per run (up to 2,000) and a drawdown threshold, such as 20% or a prop firm's maximum loss.
- Choose the number of simulated runs. More runs give steadier percentiles; 5,000 is enough for most uses.
The simulation is seeded: the same inputs always give the same result, so you can compare scenarios by changing one input at a time. "New random seed" draws a fresh set of runs and shows how much of the result is sampling noise.
The formula
For each run and each trade, a random number u between 0 and 1 decides the outcome:
if u < win rate: equity = equity × (1 + risk × average win)
otherwise: equity = equity × (1 − risk × average loss)
peak = highest equity so far, starting with the balance
drawdown = 1 − equity ÷ peak
expectancy = W × average win − (1 − W) × average loss (in R)
After all runs, the calculator sorts the final balances and the maximum drawdowns, reads their 5th, 50th (median) and 95th percentiles, and counts the share of runs whose maximum drawdown reached the threshold. The random numbers come from mulberry32, a small seeded generator, which is why results are reproducible. The chart draws the median path, the band holding the middle 90% of runs at each point, and twelve individual runs.
Worked example
With the default inputs — $10,000, 1% risk per trade, a 45% win rate, an average win of 1.5R and an average loss of 1R, 250 trades, 5,000 runs, seed 1 — the expectancy is 0.45 × 1.5 − 0.55 × 1 = +0.125R per trade, and the simulation gives:
- Median final balance: about $13,400
- Bad run (5th percentile): about $9,570, slightly below the start
- Good run (95th percentile): about $18,770
- Runs that finish below the start: about 6.7%
- Chance of a 20% drawdown or deeper: about 10%
- Median maximum drawdown: about 12.5%, and 22.7% or more in the worst 5% of runs
- Median longest losing streak: 8 trades
Same edge, same rules, and outcomes that range from a small loss to nearly doubling the account. You can check the median by hand, because the final balance depends only on the number of wins: with 250 trades at 45%, the median number of wins sits right at the boundary between 112 and 113, giving 10,000 × 1.015^112 × 0.99^138 ≈ $13,240 or 10,000 × 1.015^113 × 0.99^137 ≈ $13,570. The simulated median falls between the two.
Now change only the risk per trade:
| Risk per trade | Median final balance | 5th percentile | Chance of a 20%+ drawdown | Median max drawdown |
|---|---|---|---|---|
| 0.5% | $11,635 | $9,830 | < 0.1% | 6.4% |
| 1% | $13,406 | $9,573 | 10.1% | 12.5% |
| 2% | $17,294 | $8,831 | 73.2% | 24.0% |
| 3% | $21,478 | $7,853 | 97.6% | 34.5% |
The median grows with risk, but the bad runs get worse and deep drawdowns go from rare to almost certain. Whether you could keep trading through them matters more than the median.
Reading the result
- The median is not a promise. Half the runs end below it, and it assumes your win rate and payoff hold on every trade.
- Plan around the bad runs. Ask whether you would keep following the plan through the worst-5% drawdown. If not, lower the risk per trade.
- Drawdowns depend on the path. Two runs with the same final balance can have very different drawdowns, which is why simulation is needed to measure them.
- The model is simpler than markets. Wins and losses are fixed amounts, trades are independent and costs are ignored. Real results, with variable trade sizes, losses that cluster in some market phases, spreads and slippage, are usually more dispersed. Read the output as a best case for the spread of outcomes.
For a single figure on the risk of losing a set share of the account, use the risk of ruin calculator; for the arithmetic of losing streaks, the drawdown calculator.
Common mistakes
- Feeding in backtest numbers unadjusted. Live win rates are usually lower than in-sample ones. Run a second scenario with a few points less win rate and compare.
- Using too few runs. With 1,000 runs the tail percentiles move noticeably with the seed. Use 5,000 or 10,000 when you read the 5th and 95th percentiles.
- Ignoring the losing streak. A median longest streak of 8 means most runs contain eight losses in a row somewhere. Make sure your risk per trade survives that comfortably.
- Comparing seeds instead of inputs. Keep the seed fixed and change one input at a time; changing the seed only shows sampling noise.