Monte Carlo simulation of portfolio returns with a block bootstrap
On this page
Key takeaways
- A single backtest is one path through history. A bootstrap reshuffles that history into thousands of alternative paths of the same length, to show how much the outcome could have depended on the luck of which months came when.
- Drawing blocks of consecutive months, instead of single months, keeps short-run patterns such as calm and turbulent stretches; the circular version wraps around the end of the history so every month is equally likely to be drawn.
- The result is a fan of outcomes: the middle path and the bad and good cases for the ending value, the share of paths that lost money, and the typical and bad-case worst decline along the way.
- A bootstrap only reuses the months it was given. It cannot produce a kind of market that is not in the history, and with short blocks it breaks up long bear markets, so a typical path's worst decline is milder than history's deepest.
- MarketHeist resamples monthly total returns with a fixed random seed, so the same setup always draws the same paths; unless one is chosen, the block length grows slowly with the length of the history.
Definition
A Monte Carlo simulation of portfolio returns generates many possible future paths and reads the spread of their outcomes. A block bootstrap builds each path by drawing runs of consecutive historical months at random, with replacement, so the simulated returns keep the history's distribution and short-run clustering without assuming a bell curve.
Also known as: Monte Carlo simulation, bootstrap simulation, block bootstrap, circular block bootstrap, historical bootstrap, resampling returns, fan chart, probability of loss.
How it works
Start with the monthly returns of a portfolio over its whole history. To build one simulated ten-year path, pick a month at random and take it together with the months that followed it, a block of, say, eight consecutive months. Then pick another random starting month and take the next block, and so on until the path has 120 months. Compound those returns from a starting value. Repeat a few thousand times and sort the ending values: the middle one is the median outcome, and the 5th and 95th percentiles bracket nine paths in ten.
The method is Bradley Efron's bootstrap of 1979, which estimates how uncertain a statistic is by resampling the data it was computed from. Drawing single months at random would treat every month as independent of the one before. Market returns are not quite like that: volatile months cluster, and declines unfold over several months. Hans Künsch's block bootstrap of 1989 keeps those short-run patterns by drawing runs of consecutive months; Politis and Romano's circular version joins the end of the history to its start, so months near either end are drawn as often as the rest.
Block length is a trade-off. Longer blocks keep longer patterns, such as a bear market that takes a year and a half, but there are fewer distinct ways to combine them, so the paths look more like history. Shorter blocks give more variety but scatter long episodes into pieces. A common rule, used here by default, sets the block to about the cube root of the number of months.
The bootstrap is like shuffling and re-dealing chapters of a diary: the new orders tell you how differently the year might have read, but no chapter that was never written can appear. If the history contains no decade-long bear market, the simulation contains none either, and if the history was unusually strong, the simulated paths inherit that strength.
Formula
- rₜ*
- the simulated return in month t of the path (months counted from 0)
- rᵢ
- the historical monthly return with index i, from 0 to n − 1
- n
- number of historical months
- b
- block length in months
- k, j
- the block number within the path and the position within the block
- sₖ
- the random starting month of block k, drawn with replacement
The path is cut to the horizon H = 12 × years months, so the last block can be partial. Indices wrap around (mod n), which is what makes the bootstrap circular.
- V_H
- value of $10,000 at the end of a path of H months
- Vₜ
- value of the path at the end of its month t
- DD
- the worst decline from a running peak along the path (zero or negative)
Over all paths, the fan reports the 5th, 50th and 95th percentiles of V at each month, the share of paths with V_H below $10,000, and the median and 5th percentile of DD (the latter is the bad case: one path in twenty fell further).
- b
- block length in months
- n
- number of historical months resampled
The cube-root rate is the order of block length that balances bias and noise for estimating the uncertainty of averages under weak dependence (Hall, Horowitz and Jing, 1995). Forty years of monthly data give a block of about eight months.
Worked example
The S&P 500 (SPY, extended back with its index mutual fund), monthly total returns from Feb 1985 to Sep 2026, resampled into 2000 paths of ten years, each built from blocks of 8 consecutive months and starting from $10,000.
Half the simulated paths ended above $29,632. One in twenty ended below $12,473, and one in twenty above $60,638: the same history, re-dealt, gives a wide range of ten-year results. Only 2.1% of the paths ended below the $10,000 they started with.
That last figure is more comfortable than the actual record. The S&P 500 ended the ten years from 2000 to 2009 below where it started. The simulation draws from the whole window, most of which was strong for US stocks, so a decade that poor is rare among its paths: the bootstrap reports the luck of the draw within this history, not the chance of a weaker one.
Declines along the way tell the same story. The median path's worst fall from a peak was -28.0%, and one path in twenty had a worst fall of -49.8% or deeper, about as deep as the actual worst decline in the history, -50.8% from 2007 to 2009. The typical path is much milder: with blocks of 8 months, a bear market that took well over a year is cut into pieces and scattered among calmer months, so most simulated paths do not rebuild it.
Read the fan as a measure of how much a ten-year outcome depends on which stretches of this history happen to come up, not as a forecast. Longer blocks, a different horizon or a portfolio with a different history change it; the lab lets you try each.
Data through Sep 2026. Reproduce id 2dfff56010a8be60 (this guide, its lab setup and the data month).
Interactive lab
The fan of simulated values of $10,000: the median path and the 5th to 95th percentile band, with the last stretch of actual history of the same length drawn over it, and the table of ending values, share of losing paths and worst declines. Change the horizon, the block length or the portfolio.
| Measure | S&P 500 (100%) |
|---|---|
| 5th percentile after 10 years | $12,473 |
| Median | $29,632 |
| 95th percentile | $60,638 |
| Paths ending below $10,000 | 2.1% |
| Median worst drawdown along a path | -28.0% |
| Deep-tail worst drawdown (5th percentile) | -49.8% |
| History: worst drawdown, 500 months | -50.8% |
| History: $10,000 over the last 10 years | $41,286 |
| Paths, block length, seed | 2,000, 8 months, 20261025 |
Each path draws blocks of 8 consecutive months from the 500 months of history (wrapping around the end) until it has 120 months; percentiles interpolate between the two nearest paths. The same seed gives the same paths. The drawdown of a path is measured from its running high, the first month-end being the first high. Feb 1985 to Sep 2026.
How MarketHeist computes it
Every choice an implementation has to make, as the code makes it today. The page is checked against the code each time it is built.
| Choice | How it is computed | In the code |
|---|---|---|
| Data | Monthly total returns (dividends reinvested). Funds younger than the period shown are extended backward with older funds, spliced on returns, not prices. | |
| Window | The paths are resampled from the whole history of the portfolio, Feb 1985 to Sep 2026 (500 months), ending at the data month of this page; the historical path drawn over the fan is its last stretch of the horizon's length. | |
| Portfolio streams | A fund is its proxy-extended monthly return stream. A built-in portfolio is read as the MarketHeist MCP reads it: its composed stream with its own rebalancing rule and overlay. A custom mix is rebalanced yearly. | |
| Block bootstrap | A circular block bootstrap: each path is built from blocks of consecutive monthly returns, each block starting at a month drawn at random from the whole history and wrapping around the end, until the path has the horizon's months. The random draws come from the engine's seeded generator, so the same seed gives the same paths in every runtime. The 5th, 50th and 95th percentile are taken across paths with linear interpolation between the two nearest ranks; the worst drawdown of a path is measured from its running high, the first month-end being the first high; the deep-tail drawdown is the 5th percentile of those (the drawdown only one path in twenty is deeper than). Dollar figures start at $10,000. | |
| Resampling | Circular block bootstrap of the portfolio's monthly total returns over its whole history ending at the latest data month: each path is a horizon of 12 × years months built from blocks of consecutive months, each block starting at a month drawn uniformly at random with replacement and wrapping around the end of the history. The last block of a path is cut to fit. | bootstrapSidecontent-engine/lab/compute4.ts |
| Random numbers | The engine's seeded generator (mulberry32) with a fixed default seed, so the build, the lab in any browser and a rerun next month draw the same block starts for the same setup. | BOOT_SEEDcontent-engine/lab/compute4.ts |
| Paths and block length | 2,000 paths by default. The default block is the cube root of the number of historical months, rounded; the lab offers 1 (independent months) to 24. | BOOT_PATHScontent-engine/lab/compute4.ts |
| Percentiles | Linear interpolation between the two nearest ranks, at position p × (N − 1) of the sorted values. The fan is the 5th, 50th and 95th percentile of the path values at each month; the worst-decline figures are the 50th and the 5th percentile of each path's maximum drawdown (the 5th being the deeper tail). | quantileSortedcontent-engine/lab/compute4.ts |
| Historical comparison | The actual path drawn over the fan is the last stretch of history as long as the horizon; the historical worst decline in the table is over the whole history, as on the portfolio's page. | |
| Backtester | The backtester's Monte Carlo panel runs the same circular block bootstrap on a strategy's bar returns (daily, weekly or monthly), with a default block of the cube root of the number of bars and its own fixed seed. It reports the fan, the probability of ruin (the share of paths that ever fell below half the starting value) and, separately, an order-risk test that reshuffles the same returns without replacement, which changes the path but not the ending value. | runMonteCarloapps/backtest/src/engine/montecarlo.ts |
| Engine functions | The functions the portfolio app and the MarketHeist MCP tools run, called here on the same monthly returns. | mulberry32packages/shared/engine/robustness.tsdrawdownpackages/portfolio/engine/metrics.ts |
Monte Carlo simulation of portfolio returns (block bootstrap) compared with its neighbours
| Method | Draws | Keeps | Loses |
|---|---|---|---|
| Parametric Monte Carlo (normal returns) | Random returns from a bell curve with the history's mean and volatility | Average and volatility | Fat tails, skew, volatility clustering |
| Bootstrap of single months (Efron) | Historical months, one at a time, with replacement | The actual distribution of monthly returns | Any link between one month and the next |
| Block bootstrap (Künsch; circular: Politis and Romano) | Runs of consecutive historical months | The distribution and short-run clustering | Patterns longer than a block, such as multi-year bear markets |
| Stationary bootstrap (Politis and Romano, 1994) | Runs of random, geometrically distributed length | As the block bootstrap, with less sensitivity to one block length | Patterns much longer than the average run |
| Reshuffle (permutation) | The same months in a new order, without replacement | Every return exactly once | Any spread in the ending value: every reshuffle ends at the same value |
| Historical rolling windows | Every actual ten-year stretch | Real sequences, nothing invented | Number of independent cases: few, and they overlap |
Limitations
- Resampling reuses history. No simulated month is worse than the worst historical month, and no regime absent from the window, such as a long inflationary bear market for bonds if the history has none, can appear.
- If the history was unusually good or bad, the simulated paths inherit it. A window dominated by a long bull market produces optimistic fans; the median simulated growth rate stays close to the historical one.
- Short blocks break up long declines and slow recoveries, so a typical simulated path's worst decline is shallower than history's deepest; only the bad tail of the paths reaches it. Longer blocks keep more of them but make the paths more alike.
- Monthly data hide moves within a month, and the paths ignore costs, taxes, withdrawals and contributions; with regular withdrawals the order of returns matters much more than here.
- Long histories are extended backward with older funds or indexes where a fund is younger than the window, so early months approximate the fund rather than reproduce it.
Frequently asked questions
- What does a Monte Carlo simulation of a portfolio tell you?
- How widely the outcome could vary given the kind of returns the portfolio has had. Built by bootstrap, it rearranges history into many alternative paths and reports the spread of ending values and declines. It does not say which path comes next, and it cannot include market conditions absent from the history it resamples.
- Why use a block bootstrap instead of drawing single months?
- Because returns in neighbouring months are not independent in the ways that matter for risk: turbulent months cluster and declines take several months to unfold. Drawing blocks of consecutive months keeps that clustering, which single-month draws destroy. The price is that patterns longer than a block are still broken up.
- How long are the blocks?
- There is no single answer. A common rule is about the cube root of the number of observations, which gives roughly eight months for forty years of monthly data. Longer blocks keep longer episodes intact; comparing a few block lengths in the lab shows how sensitive the result is.
- Is a bootstrap better than assuming normal returns?
- It avoids the bell-curve assumption, so fat tails and skew in the history carry into the simulation. It is still bounded by the history: a parametric model can produce a month worse than any in the record, a bootstrap cannot.
- What is the probability of ruin in the backtester's Monte Carlo panel?
- The share of simulated paths that at any point fell below half of their starting value. Like the other bootstrap figures, it describes the history being resampled and is sensitive to the block length.
References
- Efron, B. (1979) Bootstrap Methods: Another Look at the Jackknife. Annals of Statistics 7(1). The bootstrap.
- Künsch, H. R. (1989) The Jackknife and the Bootstrap for General Stationary Observations. Annals of Statistics 17(3). The moving block bootstrap.
- Politis, D. N. and Romano, J. P. (1992) A Circular Block-Resampling Procedure for Stationary Data. In LePage and Billard (eds.), Exploring the Limits of Bootstrap, Wiley.
- Politis, D. N. and Romano, J. P. (1994) The Stationary Bootstrap. Journal of the American Statistical Association 89(428).
- Hall, P., Horowitz, J. L. and Jing, B.-Y. (1995) On Blocking Rules for the Bootstrap with Dependent Data. Biometrika 82(3). Block length of order n^(1/3).
Try it on your own holdings
Run a backtest and open its Monte Carlo panel →
Or ask an assistant connected to the MarketHeist MCP server (https://marketheist.io/mcp), which computes the same figures:
Using MarketHeist.io, take monthly S&P 500 total returns since 1985 and run a circular block bootstrap of 2,000 ten-year paths from $10,000 with 8-month blocks: what are the 5th, 50th and 95th percentile ending values, what share of paths lost money, how deep is the median and the 1-in-20 worst decline, and what can such a simulation not capture?
Ask an AI assistant
The prompt opens in a new tab, already filled in. An assistant without the MarketHeist connector answers from its own knowledge, not from the figures on this page.
Historical simulation, not advice. Computed by the MarketHeist portfolio engine from monthly total returns, data through Sep 2026. Markdown version of this page: monte-carlo-simulation.md.