Cointegration Testing and Overfitting Risks in Pair Trading
Summary
This tutorial develops the statistical basis for pairs trading. It explains how a temporary divergence between related assets can be traded by shorting the relatively stronger asset and buying the weaker one, with the expectation that their spread will revert. A simulated pair illustrates cointegration, and comparisons show that high correlation does not guarantee cointegration, while low correlation can coexist with a stationary relationship. The article demonstrates a cointegration test and discusses scanning related stocks for candidate pairs.
It warns that testing many pairs inflates false discoveries and that candidate relationships need further verification. A rolling-window example shows how selecting parameters for the strongest training result can perform poorly out of sample, illustrating overfitting. Suggested alternatives or further tools include economic reasoning, half-life estimation, Hurst analysis, and Kalman filtering. The examples are introductory; a real strategy still needs careful pair selection, robust validation, and attention to execution and trading costs.
Key ideas
- Pairs trading seeks to profit from reversion in the spread between related assets.
- Cointegration is a different property from correlation and should be tested directly.
- Searching many pairs increases false discovery risk and calls for additional validation.
- Selecting a window to maximize training returns can overfit and fail out of sample.
- Economic reasoning and recursive methods can help guide parameter choices.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.