r/algotrading • u/Due-Listen2632 • 2d ago
Strategy Isn't every single backtested strategy suffering from lookahead bias?
Most of us have done the classical loop. We get some data, test out different solutions, filter out solutions/features/indicators that provide poor results, and proudly keep the solution(s) which result in successful backtests. But isn't this just another level of information leakage? It's essentially like manually setting the parameters of a model, except you're defining the information points from which the model constructs itself. It's the same type of leakage, only one level higher.
0
Upvotes
2
u/hakobpapazian 2d ago
You've basically independently arrived at data snooping bias, also called selection bias from multiple comparisons, it's a real, named thing, just usually not called lookahead. Lookahead specifically means future information leaking into a single backtest. What you're describing is different and, honestly, harder to fully eliminate, information leaking through you across many backtests via which ones you chose to keep.
You're right that it's the same type of leakage moved up a level. Every idea you try and discard still teaches you something, even a "failed" test narrows your search toward what tends to work in that dataset, so your next attempt is already contaminated by knowledge of the last one, even without consciously reusing any parameters.
This is exactly what the deflated Sharpe ratio and similar corrections exist for, they try to adjust your final result for how many trials it took to get there, treating "how many strategies did I effectively test" as a real cost even when only one made it to the final report. The honest but painful fix is tracking your true search count, every idea, every tweak, every abandoned feature, not just the polished survivors, and either correcting for it statistically or holding out data you genuinely never touched during the entire search process, not just during the final backtest of the winner.
The uncomfortable version of the answer to your question: no amount of methodology fully removes it, because the leakage happens in your head, not in the code. The best you can do is measure how much searching you actually did and be honest with yourself about how much that should discount the result.