Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 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.

Hi @Tim.Diego

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS


Hi @Tim.Diego ,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
17.1k 80 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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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