EPS Trailing 12 Months of a company

Hello, I am trying to download on Python the EPS Trailing 12 month of a company.


Until now, I found the EPS reported for the last Year of the company, using the command:

data_EPS = ek.get_data('AAPL.O', ["TR.EPSActValue.calcdate","TR.EPSActValue"], {"SDate":"0", "EDate" : "0", "Frq" : "Y"})[0].dropna()

and I correctly find the estimate 3.28 for 2020


However, I would like to get the code for EPS Traiing 12 month, which corresponds to the last 4 available reported quarters.
In the case of AAPL.O, the company already reported Q121 results and the estimated value should be 3.70.

What is the correct field to be entered?
If it is required to use Datastream colud you provide me the whole formula please?


Thank you for your help


Daniele

Best Answer

  • @daniele.bonanomi If you want the last 4 quarters you can try:

    data_EPS,err = ek.get_data('AAPL.O', ["TR.EPSActValue.date","TR.EPSActValue"], {"SDate":"-3", "EDate" : "0", "Period":"FQ0","Frq" : "FQ"})

    data_EPS

    image

    Im not sure if this is what you want or if you want the sum of these values? I hope this can help.

Answers

  • Hi Jason, thank you for your help
    Yes, I need the field for the yearly estimate, which is basically the sum of the 4 EPS that you reported.

    I will sum them together

    Thanks