Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Trying to pick 20 stocks from Filter Pipeline

Hi, Quantopians!
I am new to the Platform, learning first things, watching tutorials and making first steps.
I stuck trying to make subset from filter based on daily returns, wanted to pick 20 stocks with poorest results from the filter.
Is there any way how to do it?
Thank you in advance for your help!

3 responses

I finally got it.
Thanks! :))

Your line below doesn't have the proper syntax (which is causing the error).

is_tradeble = (base_universe & top_mkt_cap).bottom(20, mask=recent_returns) 

Maybe consider breaking the problem into two lines

is_tradeble = base_universe & top_mkt_cap  
poorest_returns = recent_returns.bottom(20, mask = is_tradeble)  

See attached notebook.

Dan, Thank you for your help and reply! Finally, I realized it :)