Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Pricing securities based on their industries

I have an idea for an algorithm. I was reading Joel Greenblatt's book called You Can Be A Stock Market Genius and noticed that the way he valued/priced a spinoff was to compare it's P/E to the P/E average for that industry. I contrasted this with the method used for the Magic Formula and Deep Value where multiples (EBIT/EV usually) were compared across all industries. My idea is to form a P/E distribution for each industry, then compute the z-score for each company given its industry, and rank based on the z-score instead of the raw P/E multiple.

How would you implement this algorithm on Quantopian? I'm not sure if there's a data source that even classifies securities based on their industries (Morningstar has sectors, but I think I'd need more granularity than that). Even if I did get a industry classification for each security, I'm not sure how I would do the calculations for the distributions, since the Pipeline API seems to be focused on computing values on a per security basis, not a per industry basis.

Any thoughts or suggestions?