How to translate adfin formula for previous coupon date in API?

How to translate adfin formula for previous coupon date in API?

=CpnPrev(TODAY(),TR($B3,"TR.ADF_MATDATE"),TR($B3,"TR.ADF_BONDSTRUCTURE"))

B3 is the Bond e.g. XS1970549561

Best Answer

  • nick.zincone
    nick.zincone admin
    Answer ✓

    Hi @Tim.Diego

    Try the following:

    import refinitiv.data as rd
    from refinitiv.data.content.ipa.financial_contracts import bond

    # Open a session
    rd.open_session()

    # Using the Fundamental and Reference service
    rd.get_data(['XS1970549561'], ['TR.ADF_MATDATE', 'TR.ADF_BONDSTRUCTURE'])

    ##############
    # Alternatively
    ##############

    # Using Instrument Pricing Analytics
    response = bond.Definition(
    instrument_code = 'XS1970549561',
    fields = [
    "InstrumentCode",
    "BondType",
    "Structure",
    "RateStructure"
    ]
    ).get_data()
    response.data.df

Answers