Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
market cap filter

hello,

how can I create a filter by market cap (highest N stocks) from the S&P index to feed to my pipeline? since that dataset does not change daily, what is a good frequency for computing it dynamically?

thanks
-kamal

1 response

To set up the first filter you could use filter = morningstar.valuation.market_cap.latest.top(n) where n is the number of stocks. Then adding Q500 as the second filter should be similar to using the S&P index.