Today, I would like to share a research notebook that includes a couple of examples to build alpha factors with cointegrated pairs. The pairs trading strategy has been around for a long time, and Quantopian has lectures to introduce the idea and how to implement it. Here, we want to introduce a different way to use cointegrated pairs. The basic idea is that if some event happens to one leg of the pair, like an earnings announcement that beats estimates, it is more likely that the market would price a higher chance of the same thing will happen to the other leg too, so in this case, the other leg would also beat estimates.
The attached notebook illustrates this idea by importing a set of cointegrated pairs via the self serve data tool and using the predetermined set of pairs to build two example factors. Use them as a guide and a starting point, but we encourage you to use your creativity to come up with novel ideas and share the tearsheets below in this thread.
About the self serve dataset, first off, we looked through the stocks in the Quantopian tradable Universe (QTU) to see if any of them are cointegrated. We looked for cointegrated pairs by running the cointegration test for the assets in the QTU every month starting from 2012-01-04 to 2019-05-29 (the methodology is mainly based on the lecture, Introduction to Pairs Trading). We then converted the list of pairs into a Q self-serve data format for you to use. To learn how to use self-serve data, please refer to Upload Your Custom Datasets and Signals with Self-Serve Data and Analyzing a Signal and Creating a Contest Algorithm with Self-Serve Data. You could use all of pairs or some of the pairs we provide to generate your alpha factors. Of course, you could generate the pairs with your own method and use them as input data.