Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Check if ROA has increased from the previous quarter?

Is there anyway to compare the latest ROA with the previous quarter's?

2 responses

Tr this Nathan -

    roa = Fundamentals.roa.latest  
    roa_1q = Value_N_Days_Ago(inputs=[Fundamentals.roa], window_length=66)

    pipe = Pipeline(  
        columns={  
            'roa': roa,  
            'roa_1q': roa_1q,  
        },  
        screen=screen  
    )  
    return pipe

class Value_N_Days_Ago(CustomFactor):  
    def compute(self, today, assets, out, inputs):  
        out[:] =  inputs[0]  

Thanks @Nadeem!