Monte Carlo simulation for trading

by , founder of Stochastly

Why can shuffling trades understate the maximum drawdown a strategy could suffer?

Random reordering treats trades as independent, so it breaks up the losing streaks that cluster in certain market regimes. A block bootstrap resamples runs of consecutive trades and keeps that clustering inside each block.

Bootstrap paths reuse the strategy's own past results and cannot show a loss pattern absent from that history.

A Monte Carlo simulation generates many alternative sequences of a strategy's results to show the range of drawdowns and outcomes it could have produced.

Trade shuffling

The simplest method reorders the historical trades at random. The net result stays the same, and the paths show how deep the drawdown could have been with another order of the same trades.

Monte Carlo equity paths in Stochastly, generated by a block bootstrap of a strategy's results.Open full size
Monte Carlo equity paths in Stochastly, generated by a block bootstrap of a strategy's results.

What shuffling misses

Random reordering assumes trades are independent. Real strategies have losing streaks that cluster in certain market regimes, and shuffling breaks those clusters, which makes the drawdowns look smaller than they can be.

“López de Prado and Peijan (2004) showed that the implied assumptions (namely, that returns are independent and identically distributed (IID) Normal) may hide substantial drawdown risks, especially in the case of hedge fund strategies.”

Block bootstrap

Resampling blocks of consecutive trades or returns keeps the dependence inside each block. The stationary bootstrap draws blocks of random length, which avoids choosing one block size arbitrarily.

What to read from the paths

The distribution of maximum drawdown, the probability of reaching a loss limit, the risk of ruin for a given position size, and the spread of final results. Stochastly draws these cones and quantiles from the strategy's own results.

Frequently asked questions

How many Monte Carlo simulations are enough?

Enough for the quantiles you read to stabilize: a few thousand paths is common for drawdown percentiles; check by running twice with different seeds.

Does Monte Carlo simulation prove a strategy works?

No. It resamples past results and cannot create an edge that the backtest does not have; it shows how variable those results are.

What is the risk of ruin?

The probability that losses reach a level that stops trading, such as a drawdown limit, for a given position size.

Sources

Bailey and López de Prado (2012). The Sharpe Ratio Efficient Frontier. Journal of Risk 15(2), 3-44.

Politis and Romano (1994). The Stationary Bootstrap. Journal of the American Statistical Association 89(428), 1303-1313.

White (2000). A Reality Check for Data Snooping. Econometrica 68(5), 1097-1126.

Primary source for Monte Carlo simulation for trading

In the library

Related