For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

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

eikon#technology#contentpython apiadfin
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvotes
Accepted
14.7k 64 39 63

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
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @nick.zincone , thank you for this, it works however the output are the Bond Type, Structure and Rate Structure. The formula above displays the previous coupon date. Is it possible to add this function to the syntax above =CpnPrev(TODAY() ?

Hi @Tim.Diego

Does it help?

import refinitiv.data as rd
from refinitiv.data.content.ipa.financial_contracts import bond
rd.open_session()

response = bond.Definition(
    instrument_code = 'XS1970549561',
    fields = [
        'PreviousCouponDate'
    ],
    pricing_parameters = bond.PricingParameters(
        valuation_date="2023-03-31",
    )
).get_data()
response.data.df