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
Hi @Tim.Diego
Try the following:
import refinitiv.data as rdfrom refinitiv.data.content.ipa.financial_contracts import bond# Open a sessionrd.open_session()# Using the Fundamental and Reference servicerd.get_data(['XS1970549561'], ['TR.ADF_MATDATE', 'TR.ADF_BONDSTRUCTURE'])############### Alternatively############### Using Instrument Pricing Analyticsresponse = bond.Definition( instrument_code = 'XS1970549561', fields = [ "InstrumentCode", "BondType", "Structure", "RateStructure" ]).get_data()response.data.df
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() ?
Does it help?
import refinitiv.data as rdfrom refinitiv.data.content.ipa.financial_contracts import bondrd.open_session()response = bond.Definition( instrument_code = 'XS1970549561', fields = [ 'PreviousCouponDate' ], pricing_parameters = bond.PricingParameters( valuation_date="2023-03-31", )).get_data()response.data.df