Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Sector Momentum Stratergy

I've just started to try create a momentum strategy looking at the best performing stocks from the best performing sectors. Is there an easy way to figure out the best performing sectors. For instance could you use get_fundamentals for filtering out sectors instead of stocks.

Thanks,
Henry

2 responses

Pipeline can now handle sectors - see https://www.quantopian.com/posts/pipeline-classifiers-are-here. "Easy" is a relative term, but my read is that pipeline should work best in the end, if you are o.k. with daily bars. That's where I'd start. See the notebook Scott attached to his post for a sector example.

I would add a Sectors classifier to your pipeline. Then in your daily code, you can use some pandas code to average the momentum within each sector. You'll need the groupby feature of pandas.

Another way of achieving your idea is to look at the intersection of top 50% of stocks by absolute momentum intersected with top 50% momentum for their industry. You can use demean groupby sector for the latter.

Note, sectors have momentum in the short term, whereas individual stocks mean revert. Combining different time frames might be helpful. Short term for industries, longer term for stocks.