Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Best way to determine trend relationship in stocks? (R-Squared, Beta, etc)

Thinking of searching the 2% universe for a portfolio of securities with highest dissimilarity in returns. Can someone please suggest a computation that will achieve this?

the algorithm i have in mind is to use SPY as sec#1, find the security with lowest similarity to sec#1 and use that as sec#2, then find the security that has the lowest similarity to sec#1 and sec#2 and use that as sec#3, etc etc...

I was thinking Beta, or maybe RSquared, but would like to hear opinions of experts on this :)

4 responses

Jason,

Not a direct answer to your question, but perhaps relevant:

https://www.quantopian.com/posts/history-api-version-of-scikits-learn-example-finding-co-fluctuating-stocks

Grant

thanks Grant, i did a quick scan of the threads and it looks somewhat related, so I'll be sure to dig into this more later.

For my own question in this post, it seems RSquared is a good indicator to start with. But I'd still like to know if there are other opinions

The hard part about what I believe you are attempting is estimating the returns in the first place. If it's just historical returns, you could look into their principal components, or the covariance of their weekly/monthly returns?

Hello Jason,

Here's something I played around with awhile back:

https://www.quantopian.com/posts/pattern-recognition-based-on-zlib

Just let me know if it'd be worth reviving and I'll update the example, as time allows.

Grant