I tried to use the fundamental functions and verify the data. Here is my code:
def initialize(context):
"""
Called once at the start of the algorithm.
"""
pass
def before_trading_start(context, data):
"""
Called every day before market open.
"""
sector_code = fundamentals.asset_classification.morningstar_sector_code
fundamental_df = get_fundamentals(
query(
sector_code,
fundamentals.valuation.market_cap,
fundamentals.valuation.enterprise_value,
fundamentals.cash_flow_statement.capital_expenditure,
fundamentals.operation_ratios.roic,
fundamentals.income_statement.ebit,
fundamentals.income_statement.ebitda,
fundamentals.balance_sheet.total_assets,
)
.filter(fundamentals.valuation.market_cap > 5e10)
.order_by(fundamentals.valuation.market_cap.desc())
.limit(2)
)
print fundamental_df
The simulation log shows that the EBITDA and total assets for AAPL are 1.34e+10 and 3.05e+11 respectively for all the days in September 2016.
However, the data on morningstar website are different. EBITDA is 7.3333e+10 and total assets are 3.21686e+11.
Did I miss anything here?
Thanks.