← Projects·Quantitative Researcher
Look-Ahead Bias Audit (the shift test)
A bias-hunting toolkit: deliberately introduce a look-ahead leak into a backtest, then detect it with a one-line shift test. If the leak survives, the equity curve is a phantom.
0.59
Clean Sharpe
5.07
Leaked Sharpe
88%
Phantom % detected
of the inflated Sharpe is leakage
Why this exists
Look-ahead bias is the silent killer of every quantitative backtest. The researcher thinks the signal uses yesterday’s close; the code uses today’s. The result is an equity curve that looks like alpha and turns out to be a leak.
What the project does
- Run a backtest with the signal as designed.
- Shift the data by one bar forward — replicating what would happen if the signal accidentally used tomorrow’s price.
- Compare the two Sharpe ratios.
The result
- Clean Sharpe: 0.59 (real signal).
- Leaked Sharpe: 5.07 (real leakage).
- 88% of the inflated Sharpe is leakage, not alpha.
What’s transferable
The one-bar shift test is a one-line audit that catches the most expensive error class in research. Every production research stack should run it as a pre-ship check — before the strategy is ever traded.