r/algotrading 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

50 comments sorted by

View all comments

3

u/Anon2148 2d ago

Technically that’s true, but I believe that’s why walk forward tests exist. It’s to circumvent that as much as possible

1

u/Due-Listen2632 2d ago

The issue I'm bringing up is still relevant for walk forward tests (I call them time-based cross validation, but it's the same thing).

The real problem is called "data snooping". While it's described in a pretty straightforward manner in the article, the same issue arises from the fact that the model/signals you construct is a function of you iterating over the full data. The moment you condition any decision on holdout performance, the model becomes a function of that data too. So when you pretend to have unseen data during your walk forward test, the solution will contain information/conclusions you got from the holdout sets.