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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
0 0 0 2

Is it possible to get historical coupon payments (amount + date) of a Fixed-rate Corporate Bond ?

Dear Developers community,

I want to retrieve historical transaction data of coupon payments (amount + date) of a Fixed-rate Corporate Bonds.

So far, I manage to gather coupon data of the amount and frequency with "'TR.ADF_COUPON', and 'TR.FiCouponFrequency'. But these fields are the current (latest, not historical) ones, with no specific date of payment.

I am looking to create a a data frame with a panel structure of j bonds and t months.

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonbonds
icon clock
10 |1500

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

Upvote
Accepted
39.2k 75 11 27

Here's a quick example using RDP Library to access IPA Financial Contracts service on RDP

bond_ric = "34540TVB5="
start_date = "2020-01-01"
end_date = "2022-01-01"
df = pd.DataFrame(columns=['Coupon Date','Coupon Value'])
while start_date<end_date:
    calc_params = rdp.ipa.bond.CalculationParams(valuation_date=start_date)
    tmp_df = rdp.get_bond_analytics(bond_ric,
                                    ["NextCouponDate","NextCouponValue"],
                                   calc_params)
    start_date=tmp_df.iloc[0,0]
    df = df.append({'Coupon Date':start_date, 
                    'Coupon Value':tmp_df.iloc[0,1]}, 
                   ignore_index=True)
df
icon clock
10 |1500

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

Upvotes
0 0 0 2

Thank you @AlexPutkov, your code worked just fine! I am getting closer to what I need.

But sometimes, I get the error:


File "<ipython-input-165-ddf031214609>", line 10, in <module>

start_date=tmp_df.iloc[0,0]

AttributeError: 'NoneType' object has no attribute 'iloc'


I managed to do a request for a list of bonds constituents in the following way:


 for i in consitutents.index:
    bond_isin = iboxx_isin['ISIN'][i]
    start_date = iboxx_isin['Issue Date'][i]
    end_date = "2021-01-01"
    while start_date<end_date:
        calc_params = rdp.ipa.bond.CalculationParams(valuation_date=start_date)
        tmp_df = rdp.get_bond_analytics(bond_isin,["NextCouponDate","NextCouponValue"], calc_params)
        start_date=tmp_df.iloc[0,0]
        df_coupon = df_coupon.append({"ISIN":bond_isin,'Coupon Date':start_date, 'Coupon Value':tmp_df.iloc[0,1]}, ignore_index=True)  
concate= pd.concat([df_coupon], ignore_index=True)

Here, a snapshot of the constituents list:


ISINIssue DateXS19071207912018-12-06XS11963800312015-03-09XS16298664322017-06-21XS20513620722019-09-11XS20513623122019-09-11




But I got the following errors:


File "/Users/mc/opt/anaconda3/lib/python3.8/site-packages/refinitiv/dataplatform/content/ipa/contracts/_financial_contracts.py", line 37, in _get_instrument_analytics

result = self.session._loop.run_until_complete(

event_list = self._selector.select(timeout)

kev_list = self._selector.control(None, max_ev, timeout)


Maybe I need to chunk the request in smaller sizes?


icon clock
10 |1500

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

Here is the structure of the constituents

Upvotes
39.2k 75 11 27

@etudiant1

I haven't been able to reproduce the issue on my end using a sample of ISINs you provided.
"AttributeError: 'NoneType' object has no attribute 'iloc'" indicates that rdp.get_bond_analytics function returned None instead of a dataframe. Have you tried isolating the issue? Does it happen randomly or does it always happen with the same ISIN(s)?
When the exception is raised, try calling rdp.get_last_status() to see the status of the last request. Using Fiddler to capture HTTP requests and see if the request corresponding to rdp.get_bond_analytics function that returned None fails would be very helpful too.

icon clock
10 |1500

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

Click below to post an Idea Post Idea