Pairs-Trading-With-Python
Pairs-Trading-With-Python copied to clipboard
Lookahead bias
Hey. Thanks for the descriptive notebook. Good job!
The problem is, that you have a lookahead bias in the trade method, which will make in significantly more likely that your buy/sell signals will generate profit. In reality, that will not be the case.
How? The look-ahead bias is not in the trade function, which properly uses the test set (out of sample). It is actually in the fact that the selection of the cointegrated pairs has been done beforehand on the whole dataset (training+test) instead that just on the training set, so very likely there is a survivorship bias for the selected pairs.