# What should the look-back period be when calculating Cointegration?

So I am confused as to what the look-back period should be when calculating Cointegration. By this I mean when running for example a Johansen or ADF test, should my look-back period be 6 months?Meaning should I be inputing 3 months? 6 months? a week? of data into the statistical tests. Is there a way to determine this? I imagine answers will vary depending on the time frame that one would intend to trade with, so then my next question would be how would you figure out which time frame to trade on? My next question is then, how long would a pair remain cointegrated for, in essence how often should I be testing for cointegration to ensure that a pair remains cointegrated? I am assuming that this information is found through backtest though is there like and "industry standard" so to speak for these time frames? Thanks!

• More than an art than a science I'd say - but there are probably some known methods. Nov 23, 2020 at 14:30
• @rubikscube09 Do you know any methods that could be used Nov 23, 2020 at 16:11
• There's no answer. The best you can do is trying tons of lookback periods, plotting the results (e.g. the largest eigenvalue from the Johansen test), and checking where structural breaks show up. Nov 23, 2020 at 20:18

As the comments suggest, there is no definitively 'gold standard' of lookback periods for such thing, especially if the underlying distribution appears to be stochastic.

I understand where you're coming from, in that you want to make sure your trading decisions are correct in that it is trading based upon a genuine statistical relationship. So I will provide some possible methods which I hope can offer some guidance.

Regarding your first point, about the specific time period itself, I would argue that it depends upon the granularity of your data (this might answer your part on which time frame data to trade on). You could choose a time frame which you feel suitably fits the granularity, and stick to it. With each new incoming datapoint at each interval, you could conduct an ADF/ Johnasen test with each data point in the lookback period and observe a 'rolling cointegration' between the assets.

The time frame data itself would ultimately depend on the data that you have on you- do you have daily/hourly/minutely data? This is where you need to be careful when setting the lookback period, and I will elaborate on my next point, about the issue of setting too long a lookback period.

If you have daily data, and you set your lookback period to 6 months, you should think about how long a time period that actually is. 6 months is a long time in that it can capture a range of differing market conditions. And as we all know, statistical relationships come and go, and more importantly, can vary under certain market conditions. If you think back to LTCM, their bets went awry under the market stress of the Russian debt crisis in the late 90's. the statistical relationship between the assets they bet on began to break down during these distinct market conditions.

So, perhaps a lookback period might not be the way in which you pivot your strategy around. You could seek to identify particular market conditions, and run these ADF/ Johansen tests during each unique market condition to observe whether the statistical relationship between 2 assets continues if the wider asset universe begins to revulse or boom. This reduces the exposure to volatile and forceful change in the wider market.

Moreover, if you run a backtest which iterates over each possible permutation of possible lookback periods, then you run into the risk of overfitting to your data.

To summarise, there is no concrete answer to this question. The suggestions that I have provided I hope can provide some guidance to your question and shine a light on alternative events to consider. At the end of the day, when trading with cointegration strategies, it's all about being consistently aware of changing conditions and relationships, and being able to mitigate them when they come.

I am more than happy to answer any more questions in the comments below.