The EBITDA(TTM) value in the fundamental database seems to be quarterly.
AAPL EBITDA = 17.167B(17,167,000,000)
in quantopian/morningstar
While EBITDA for AAPL according to
yahoo finance = 77.88 B
gurufocus = 79.642 B
I am not able to confirm the calculated value with any published TTM EBITDA value
I thought I would calculate it using Custom Factor() below
Calculated TTM EBITDA=63.286B
What am I doing wrong?
How do you calculate Trailing TTM EBITDA value accurately?
out[:] = ebitda[-1]+ebitda[-94]+ebitda[-187]+ebitda[-280]
I am accounting for each quarter as being 93 days(assuming worstcase month length of 31)
I suspect this could still be wrong if the earnings publication dates are different each quarter, but should be ball park accurate?
Also if I am to calculate Shiller PE I might need trailing 10 year earnings, does it mean I will need window_length=10*365 ?
# Create custom factor to calculate a market cap based on yesterday's close
# We'll use this to get the top 2000 stocks by market cap
class EBITDA(CustomFactor):
# Pre-declare inputs and window_length
inputs = [income_statement.ebitda]
window_length = 365
# Compute market cap value
def compute(self, today, assets, out, ebitda):
out[:] = ebitda[-1]+ebitda[-94]+ebitda[-187]+ebitda[-280]
Any suggestions?
Sarvi