# Monte Carlo simulation

Also written Monte Carlo, Monte-Carlo.

*https://stockmarketstack.com/glossary/monte-carlo-simulation · next to Retirement & FIRE Calculators*

**Definition:** A way of estimating a range of outcomes by running one plan or one strategy over many randomly generated paths and counting how those paths end. The answer is a property of the generator: a retirement planner draws returns from a distribution or resamples history, while a backtester reshuffles or resamples its own trades. Two tools' success rates are comparable only when their generators are.

## How it works

The method is always the same three steps: generate a large number of possible paths, run the same
rule over each one, and report the distribution of results — a median ending balance, a
tenth-percentile drawdown, a share of runs that did not fail. What changes between products is the
first step, and the first step decides the answer. This catalogue uses the word for three different
generators.

**Draw returns from a distribution.** [Boldin](https://stockmarketstack.com/tools/boldin) runs 1,000 iterations drawn from a
normal distribution built from your average rate of return and a standard deviation derived from
history, and its chance of success is the share of iterations that end the plan at $0 or more.
The help centre article that interprets the score says a path that runs short mid-plan and is
rescued by a later inflow still counts, although two of its methodology articles describe the same
number as iterations in which funds never run out. The parameters are not neutral. In July 2025 Boldin switched the centre of
that distribution from a compound annual growth rate to an arithmetic mean, on the reasoning that a
geometric mean already has volatility's drag built in and feeding it to a simulator that adds
volatility again counted it twice. The same release made all of a plan's accounts move together,
100% correlated, where they had been simulated independently. Either change can move a plan's
success rate without a single input being retyped.

**Resample history.** [Portfolio Visualizer](https://stockmarketstack.com/tools/portfolio-visualizer) offers four return
models: historical, which picks each simulated year at random from the available years; statistical,
from the assets' mean, volatility and correlations; parameterised, from a distribution you specify;
and forecasted, from a mean and standard deviation you supply. Around them sit a GARCH option,
fat-tailed distributions and bootstrap choices of a single month, a single year or a block of years.
The block is the one that matters for retirement arithmetic: single-year draws scatter bad years
across a run, while a block keeps adjacent years together, which is closer to how a bad decade
actually arrives. A "worst N years first" setting forces the sequence problem into the front of
every run.

**Reorder or resample a backtest's own trades.** In a backtester the word means something else
entirely. [AmiBroker](https://stockmarketstack.com/tools/amibroker) takes the N trades a backtest produced and draws a new set
of N from them with replacement, so some are skipped and some used twice, then reports
distributions of final equity, annual return, maximum drawdown and lowest equity; its guide
recommends 1,000 or more runs. [StrategyQuant X](https://stockmarketstack.com/tools/strategyquant-x) groups under the same name
tests that shuffle trade order, randomly skip trades, and retests that perturb strategy parameters
or the price history itself. [QuantStats](https://stockmarketstack.com/tools/quantstats) shuffles a series of daily returns.

Two more uses show up in cards and are unrelated to any of the above: option pricing engines in
[QuantLib](https://stockmarketstack.com/tools/quantlib) that value a contract by averaging simulated price paths, and
[Quantower](https://stockmarketstack.com/tools/quantower)'s optimiser, where Monte-Carlo names one of the methods for searching
parameter values rather than a simulation of outcomes.

## Shuffling and resampling are not the same test

The difference is arithmetic, and it catches people. Compounded growth is a product, and a product
does not depend on the order of its terms. So a permutation of the same returns always ends at the
same place: QuantStats' `montecarlo()` builds each path with a permutation of the input returns and
compounds it, which means every path finishes at one terminal value and the spread across paths is
entirely in the route taken — the drawdowns. A goal probability measured on that terminal value can
only come out at 0% or 100%. StrategyQuant says the same of its trade-order test: it does not change
the net profit.

Resampling with replacement, as AmiBroker does, is different in kind: repeating one trade and
dropping another changes the total, so the ending does vary. AmiBroker's own caveats are worth
reading before trusting that spread. A system that held overlapping positions will show smaller
drawdowns under resampling, because the trades are replayed one after another rather than at the
same time. Percent-of-equity position sizing makes each trade's size depend on the profits before
it, and the guide limits that setting to backtests in which no trades overlapped.

## Why it matters here

The headline number on a retirement planner in
[retirement planning](https://stockmarketstack.com/categories/retirement-planning) is a count over scenarios the product
invented, and it is only as good as the questions a help page will answer about the invention:
which distribution and centred on which mean, whether years are drawn independently or in blocks,
whether assets are correlated or simulated one at a time — [FIREproof](https://stockmarketstack.com/tools/fireproof)'s card
records that its Monte Carlo mode runs per asset — and how many runs. [testfolio](https://stockmarketstack.com/tools/testfolio)
caps a free Monte Carlo at 15 years and 500 runs and sells longer horizons and more runs on paid
tiers. Two planners that disagree on the same inputs are usually disagreeing about the generator,
not about you.

Some planners do not simulate at all. [cFIREsim](https://stockmarketstack.com/tools/cfiresim) and [FI Calc](https://stockmarketstack.com/tools/ficalc)
replay real historical sequences in order and have no Monte Carlo mode; their success rate is a
count over what happened, with a small sample, rather than over what a distribution could produce.
Neither kind of number is a probability about your plan.

In [backtesting](https://stockmarketstack.com/categories/backtesting-frameworks), read the name as a family of robustness
checks and ask which member was run. A trade-order shuffle tests the path and leaves the profit
alone; resampling tests the path and the mix; perturbing parameters or data tests the rule. None
of them can add information the original trades did not contain, and a strategy that passes all of
them has still only been tested against variations of its own history.

## Where you will meet this

- [Boldin](https://stockmarketstack.com/tools/boldin.md)
- [Portfolio Visualizer](https://stockmarketstack.com/tools/portfolio-visualizer.md)
- [testfolio](https://stockmarketstack.com/tools/testfolio.md)
- [ProjectionLab](https://stockmarketstack.com/tools/projectionlab.md)
- [FIREproof](https://stockmarketstack.com/tools/fireproof.md)
- [AmiBroker](https://stockmarketstack.com/tools/amibroker.md)
- [StrategyQuant X](https://stockmarketstack.com/tools/strategyquant-x.md)
- [Build Alpha](https://stockmarketstack.com/tools/build-alpha.md)
- [QuantStats](https://stockmarketstack.com/tools/quantstats.md)
- [Adaptrade Builder](https://stockmarketstack.com/tools/adaptrade-builder.md)
- [cFIREsim](https://stockmarketstack.com/tools/cfiresim.md)
- [Backtest by Curvo](https://stockmarketstack.com/tools/curvo.md)

## FAQ

### Is a 90% chance of success a 90% probability that my money lasts?

No. It is the share of the paths the model generated that ended at or above its success line. Boldin, for example, runs 1,000 iterations and counts those that end the plan at $0 or more, including paths that ran short mid-plan and were rescued by a later inflow. Change the assumed return, its standard deviation or the correlation between accounts and the same plan gets a different number, with nothing about your life having changed.

### Does shuffling a backtest's trades tell me whether the strategy will keep working?

No. Reordering the same trades leaves their total unchanged — StrategyQuant says so of its own randomize-trades-order test. What it varies is the path, so it answers how deep the drawdown could have been with these trades in another order. Whether the trades themselves would recur is a separate question it cannot reach.

## Sources

1. [Monte Carlo Simulation](https://www.portfoliovisualizer.com/monte-carlo-simulation) — Portfolio Visualizer, read 2026-09-26
2. [Boldin's Monte Carlo Simulation](https://help.boldin.com/en/articles/5805671-boldin-s-monte-carlo-simulation) — Boldin Help Center, 2025-07-10
3. [FAQ on Monte Carlo Updates](https://help.boldin.com/en/articles/11708904-faq-on-monte-carlo-updates) — Boldin Help Center, 2025-07-11
4. [Monte Carlo Simulation](https://www.amibroker.com/guide/h_montecarlo.html) — AmiBroker User's Guide, read 2026-09-26
5. [Types of robustness tests in SQX](https://strategyquant.com/doc/strategyquant/types-of-robustness-tests-in-sqx/) — StrategyQuant, 2023-07-25. The documentation page for the trade-manipulation and retest methods StrategyQuant X still ships, read on 26 September 2026.
6. [quantstats/stats.py and quantstats/_montecarlo.py, montecarlo()](https://github.com/ranaroussi/quantstats/blob/main/quantstats/_montecarlo.py) — QuantStats (GitHub), read 2026-09-26

*Last updated 2026-09-26. A reference page, corrected in place — not a dated post.*
