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

Is it possible to long/short the top/bottom quintile of a screen, instead of a number of securities?

2 responses

Just use:

longs = factor.percentile_between(80, 100, mask = mask)  
shorts = factor.percentile_between(0, 20, mask = mask)  

In the pipeline

thank you! good idea