Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Backtesting - forward vs backward

Team,
quick question. Doing backtest for one of my strategies to determine if my approach is valid or completely flawed.

I do backtesting for last 1 year and if model is fine then I do backtest for last 7 years.

If model shows it worked well for last 7 years then I consider it valid.

I know this is in contradiction to the theory where you have to first do tests for the past period and then verify with future data sets.
What would be difference in this case?

Any feedback is appreciated.
thanks in advance

4 responses

I think the theory is that older data is less relevant than newer data.

So if you test your system on a year of data from 7 years ago, and then get it to run on last years data profitably, then it is better than vice versa.
I.e. do all your overfitting etc on old data and see if it would still work on new data.

Keep in mind that the markets are always evolving, so many algos that wouldn't work many years ago, may work today. I think is part of the reason that recent data is more relevant.

Thanks for your feedback.
I fully agree with you regarding what might be ideal approach.
In this particular case, if I have situation where previous data works as good as newer set, question is would that be valid approach since it obviously works or I should completely disregard that just because theory says otherwise and look for another way to get to the same conclusion?
I didn't do any overfitting for past periods so it seems like valid approach, right?
Thanks in advance

The only way you know if you did overfitting is in hindsight, there is no way for you to know in advance.

Once you are comfortable with your algo, the only way to really know how good it is, is to trade it live (after some paper trading). But only in a live environment can you really see the true cost of slippage, commissions, interest on leverage or shorts etc. These all have to be accounted to see if your algo is actually profitable.

Mohammad, thanks again for your feedback. I guess, the only way to know is to test it in live environment.