Missing data for SP500 using fundamental_and_reference.Definition get_data

Am looking to download the following fields (list below) for SP500 index constituents, from 1995 to yesterday, daily data. Am using the following


import refinitiv.data as
from refinitiv.data.content import fundamental_and_reference
import datetime

rd.open_session()

growth_fields = ["TR.EPSMeanEstLastToNextYrGrowth",
"TR.EPSLTGEstValue(Period=FY1)",
"TR.LTGMean",
"TR.RevenueSmartEstFwdYrGrowth",
"TR.OrganicSalesGrowthMean(Period=FY1)",
"TR.GrowthCapexActValue(Period=FY0)",
"ROE",
"TR.ReturnonAvgCommEqtyPctIncomeAvailabletoCommExclExtraItems5YrAvg(Period=FY0)",
"TR.ROICActValue(Period=FY0)",
"TR.NetProfitMargin(Period=FY0)",
"TR.OperatingMarginPercent(Period=FY0)",
"TR.GrossMargin(Period=FY0)",
"TR.EBITDAMarginPercent(Period=FY0)",
"TR.LTDebtToTtlCapitalPct(Period=FY0)",
"TR.TtlDebtToTtlEquityPct(Period=FY0)",
"TR.EBITIntCov(Period=FY0)"]


lse = fundamental_and_reference.Definition(
["0#.INX"],
fields = growth_fields
).get_data()

Ho do i specify a start and end date? it appears that there are lot of missing data in the cross section, so I am looking to download a time series, and I would like to have a login in place to have the latest available data if the most recent for a given date is not yet available. Ho do I do this?

Best Answer

  • Hi @Diego.Daprile ,


    Have you tried get_history?

    rd.get_history(
    universe=["0#.INX"],
    fields=["TR.EPSMeanEstLastToNextYrGrowth",
    "TR.EPSLTGEstValue(Period=FY1)",
    "TR.LTGMean",
    "TR.RevenueSmartEstFwdYrGrowth",
    "TR.OrganicSalesGrowthMean(Period=FY1)",
    "TR.GrowthCapexActValue(Period=FY0)",
    "ROE",
    "TR.ReturnonAvgCommEqtyPctIncomeAvailabletoCommExclExtraItems5YrAvg(Period=FY0)",
    "TR.ROICActValue(Period=FY0)",
    "TR.NetProfitMargin(Period=FY0)",
    "TR.OperatingMarginPercent(Period=FY0)",
    "TR.GrossMargin(Period=FY0)",
    "TR.EBITDAMarginPercent(Period=FY0)",
    "TR.LTDebtToTtlCapitalPct(Period=FY0)",
    "TR.TtlDebtToTtlEquityPct(Period=FY0)",
    "TR.EBITIntCov(Period=FY0)"],
    start="2024-02-01",
    end="2024-02-04",
    interval='1D')



    Else I suggest you use `extended_params`:


    import refinitiv.data as rd
    from refinitiv.data.content import fundamental_and_reference
    import datetime
    rd.open_session()

    growth_fields = [
    "TR.EPSMeanEstLastToNextYrGrowth.date",
    "TR.EPSMeanEstLastToNextYrGrowth",
    "TR.EPSLTGEstValue(Period=FY1)",
    "TR.LTGMean",
    "TR.RevenueSmartEstFwdYrGrowth",
    "TR.OrganicSalesGrowthMean(Period=FY1)",
    "TR.GrowthCapexActValue(Period=FY0)",
    "ROE",
    "TR.ReturnonAvgCommEqtyPctIncomeAvailabletoCommExclExtraItems5YrAvg(Period=FY0)",
    "TR.ROICActValue(Period=FY0)",
    "TR.NetProfitMargin(Period=FY0)",
    "TR.OperatingMarginPercent(Period=FY0)",
    "TR.GrossMargin(Period=FY0)",
    "TR.EBITDAMarginPercent(Period=FY0)",
    "TR.LTDebtToTtlCapitalPct(Period=FY0)",
    "TR.TtlDebtToTtlEquityPct(Period=FY0)",
    "TR.EBITIntCov(Period=FY0)"]

    lse = fundamental_and_reference.Definition(
    ["0#.INX"],
    fields = growth_fields,
    extended_params={"Scale": 6, "SDate": 0, "EDate": -3,
    # "FRQ": "FY",
    "Curn": "EUR"
    }
    ).get_data()


    1710326159807.png


    For details on the extended_params, please watch the tutorials here, they are still relevant to rd.

    For more fields (e.g.: date), I suggest watching the DIB Video.