Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Historic 5 year average EPS

I am trying to get the historic 5 year average dilluted EPS , some reason the value calculated is not matching with Morningstar value. EPS calculation is based on the mean of EPS for the past 5 years, out[:] = np.mean(inputs[-252*5:], axis=0) Is this the correct approach or do we have a better way to calculate the same. Please find the attached notebook.

1 response

Hi Jose, wanted to do the same - I was thinking : is it correct to calculate the 5 years average on a dataset that is actually built only on one day ? I wish it worked, but my doubt is: if we the same date start_date = end_date, how can it be possible that the 5 years old data are retrieved?