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.
Best Answer
-
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)
df1
Answers
-
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-11But 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?
0 -
Here is the structure of the constituents
0 -
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.0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 162 App Studio
- 4 Block Chain
- 5 Bot Platform
- 17 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 370 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛