Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
exhaustive pairs trade screen?

I am curious if anyone has considered the problem of an exhaustive pairs trade screen? As I understand, Quantopian has N ~ 10^3 symbols in its database. Screening all possible pairs would require 0.5N(N-1) ~ 10^6 screening iterations.

Is this approach something Quantopian could support now or in the future?

Naively, it would seem that the problem is tractable, so long as the screening algorithm is efficient. For example, on the Nvidia website I see that desktop GPUs can have thousands of cores, so perhaps the total screening time could be cut down by at least three orders of magnitude with parallel computing.

2 responses

@Grant, we have considered just this. The scale jumps when you consider screening over 10 years - you need to rescreen periodically, say every day at a minimum. That means 252 trading days / year X 10 years = 2520 re-calcuations of the screen. 2520 X 10^6 = 2.5 billion calculations.

We think we could do this if we had a static universe screen, but it doesn't seem reasonable to do this for all possible parameters to the screen (e.g. you could rescreen based on correlation, p-value of an OLS, etc).

Sound right?

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

I think you would want to screen based on a stationarity test (Augmented Dickey Fuller, Granger Engle come to mind), not a correlation value or an OLS fit