Free tool · Overfitting playground
The best of 1,000 random strategies
Every strategy below trades on coin flips, so none has an edge. Pick the one with the best backtest, then reveal the future.
Playground
In-sample · 10 years
Best of 1,000: Sharpe … in-sample.
Needs JavaScript to run the simulation.
Growth of $1, log scale. The shaded region is the out-of-sample period: data that exists but was not used to pick the champion.
In-sample vs out-of-sample Sharpe
Reveal the future to see how every strategy did.
Why the champion fails
With 10 years of daily data, a strategy with no edge still shows a Sharpe ratio that wanders about ±0.32 by chance. Try 1,000 of them and the best lands about three standard deviations up. That is multiple testing: run enough trials and one of them will clear any bar. Picking the winner selects the luckiest noise, and luck does not carry into new data. The deflated Sharpe ratio corrects for the number of trials; our method shows how an audit uses it.
Synthetic by design. The market here is simulated and every strategy is random positions with no real edge; nothing is fitted to real prices. Real backtests add more ways to fool yourself (look-ahead, costs, survivorship), not fewer.
Statistics, not investment advice.
How the simulation works
Coin flips on a random walk
The market. One asset with independent, normally distributed daily returns at the volatility you choose. In random-walk mode the drift is zero; in realistic mode it is +6% a year, roughly an equity index.
The strategies. Each one picks a holding period between 2 and 120 trading days, then at every rebalance flips a coin: long or flat for half the strategies, long or short for the other half. The coin never looks at prices. That is the point: these stand in for the parameter choices of a real search (lookback windows, thresholds, filters), stripped of any real signal.
The champion. The strategy with the highest annualised Sharpe ratio over the in-sample years. Out-of-sample, the same rules keep running on data the selection never saw.
What to expect. Across many seeds the champion’s out-of-sample Sharpe averages about zero in random-walk mode. In realistic mode it averages what market exposure pays (a long/flat coin flip holds the market half the time), no more than a strategy picked at random. Single runs vary; try a few seeds.
Theory vs simulation. The expected best Sharpe uses Bailey and López de Prado’s formula for N independent trials with Sharpe variance 1 / years. The strategies here share one market, so the long/flat ones are partly correlated and behave like somewhat fewer independent trials; the simulated best is usually a little below the formula.
Bailey, D. H. & López de Prado, M. (2014). The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting and Non-Normality. Journal of Portfolio Management 40(5), 94–107. SSRN 2460551
Bailey, D. H., Borwein, J., López de Prado, M. & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the AMS 61(5), 458–471.
The simulation runs entirely in your browser. The maths is the same code as the luck calculator.