Hi, I am trying to get my algo to work in live trading, but my get_fundamentals call is not working correctly. It works when I backtested it but it returns an empty dataframe when I run it in live. Any ideas?
fundamental_df = get_fundamentals(
query(
fundamentals.valuation_ratios.pe_ratio,
fundamentals.valuation_ratios.pcf_ratio,
fundamentals.valuation_ratios.fcf_ratio,
fundamentals.operation_ratios.roic
)
#.filter(fundamentals.valuation.market_cap > 1e6)
.filter(fundamentals.valuation.shares_outstanding != None)
.filter(fundamentals.company_reference.country_id != "CHN")
.filter(fundamentals.company_reference.business_country_id != "CHN")
.filter(fundamentals.general_profile.headquarter_country != "CHN")
.filter(fundamentals.valuation.shares_outstanding < 1e9)
.filter(fundamentals.income_statement.ebitda > 0)
.filter(fundamentals.cash_flow_statement.operating_cash_flow > 0)
.filter(fundamentals.operation_ratios.total_debt_equity_ratio < 1)
.filter(fundamentals.operation_ratios.current_ratio > 1)
#.filter(fundamentals.asset_classification.morningstar_sector_code != 103)
#.filter(fundamentals.asset_classification.morningstar_sector_code != 207)
.order_by(fundamentals.valuation_ratios.ev_to_ebitda.asc())
.limit(10)
)
log.info("fundamental_df length: " + str(len(fundamental_df.columns)))