Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Creating a factor which is the total count of True/False values created by pipeline Filters for each stock within a pipeline.

Hi there,

I am trying to create a factor which is the total of all True/False filters a stock has within a pipeline so that I can use this as a 'score' to go long/short. Example is:

def roe(mask=initial_screen):  
    return or_.roe.latest

roe1 = roe()

ROEF = roe1.percentile_between(40, 100)  
pipe.add(ROEF, 'ROEF')

Now if the stock passed this filter and has a value of 'True' within the pipeline, then that would be counted towards the total of true values for that stock as a factor. Any help would be appreciated :)

Regards,

Ross D