How picking the best of many random strategies overstates it
This page draws synthetic numbers and then keeps the row with the highest in-sample score. That is a picture of backtest overfitting and of multiple testing. It is not a market, not a forecast, and not a result from any trading Rehan has done.
The result appears here when the page script runs.
How it is computed
- Draw
- Each day is an independent standard normal number from a seeded generator. The true mean is zero by construction. The series is not a price from an exchange.
- Row
- A row is a sequence of positions, each plus one or minus one, from its own seeded stream. Except for the peek switch, a row does not see the returns.
- Score
- On each half of the window, the score is the sample mean of position times return, divided by the sample standard deviation. It is not annualized, not a return, and not a Sharpe ratio of a portfolio. A zero spread abstains.
- Selection
- The page keeps the row with the highest in-sample score. A tie keeps the smaller index. The other rows stay in the table, including the ones that lost.
- Holdout
- The second half is not used to choose the row. A holdout does not repair a rule that was chosen because it won, and it does not catch a leak that is present in both halves.
- Peek
- When the switch is on, row 0 is replaced by the sign of the same-bar return. The other rows stay noise. That leak is a demonstration. It is not a method to trade.
- Ladder
- Four trial counts, peek off, share the seed. Each larger count contains the smaller count, so the in-sample maximum does not fall as the count rises. The out-of-sample column is whatever row was selected. It is not itself selected.
- Replay
- The seed, the trial count, the day count, and the peek flag are written into the address bar. The same address repeats the same table in this JavaScript engine. Last digits follow that engine.
- Sources for the idea
- Bailey, Borwein, Lopez de Prado, and Zhu named backtest overfitting. Harvey, Liu, and Zhu wrote about multiple testing in the factor literature. This page does not reimplement their estimators, and it does not apply a t-statistic hurdle. The names are the sources of the question. The numbers are this page's synthetic draws. See DOI 10.21314/jcf.2016.322 and DOI 10.1093/rfs/hhv059.