Understanding why certain bonds return no data from RDP "get_bond_analytics" python function

I am using the RDP python package's `get_bond_analytics` function to get bond cashflow data like so:
```
import refinitiv.dataplatform as rdp
from refinitiv.dataplatform.content.ipa import bond
df = rdp.get_bond_analytics(
universe=[<List of RICS codes>],
fields=[
'Isin',
'RIC',
'Cusip',
'Sedol',
'Ticker',
'CashFlowDatesArray',
'CashFlowInterestPercentsArray',
'CashFlowCapitalAmountsInDealCcyArray',
'CashFlowAnnualRatesPercentArray',
'CashFlowTotalPercentsArray',
],
calculation_params=bond.CalculationParams(market_data_date="2000-01-01"),
)
```
However, I cannot get data for about 700 bonds in our universe. Please can you help me understand why there is no data?
Example RIC codes with missing data:
'AU9YT=RR'
'225401BB3=2M'
'61772BAC7=1M'
'GR15YT=RR'
'AT7YT=RR'
'225401AY4=2M'
'55608JBF4=2M'
'06406RBR7=2M'
'XS007437161=2M'
'FR001400I3N=2M'
Best Answer
-
Hi @jonathan.legrand, thanks for your response. Is there a way of using the new RD library for getting data for multiple bonds at the same time? I have a large universe of ~20,000 bonds I want to get data for. It looks like it doesn't have a "get_bond_analytics" function anymore. I can see the `rd.get_data()` function, but unsure how to define the parameters. For example, something like the below:
rd.get_data(
universe=['AU9YT=RR', '225401BB3=2M', ...],
fields=['Isin', 'RIC', 'CashFlowDatesArray', ...],
parameters={"MarketDataDate": "2000-01-01"}, # not sure about this part
)0
Answers
-
Hi @ed.jeffery ,
I would advise upgrading to the new RD library for Python. Looking into it, I was able to collect data with it, e.g.:
import refinitiv.data as rd
from refinitiv.data.content.ipa.financial_contracts import bond
rd.open_session()
response = bond.Definition(
instrument_code="AU9YT=RR",
fields=[
'Isin',
'RIC',
'Cusip',
'Sedol',
'Ticker',
'CashFlowDatesArray',
'CashFlowInterestPercentsArray',
'CashFlowCapitalAmountsInDealCcyArray',
'CashFlowAnnualRatesPercentArray',
'CashFlowTotalPercentsArray']).get_data()
response.data.df0 -
Hi @ed.jeffery ,
Is this it? I believe the limit is 100 per call; above that you will need a loop as shown here (search for `batch_of: int = 100` in the article).import refinitiv.data as rd
from refinitiv.data.content.ipa.financial_contracts import bond
rd.open_session()
definitions = [
bond.Definition(
instrument_code=i)
for i in ['AU9YT=RR', '225401BB3=2M', '61772BAC7=1M',
'GR15YT=RR', 'AT7YT=RR',
'225401AY4=2M', '55608JBF4=2M',
'06406RBR7=2M', 'XS007437161=2M','FR001400I3N=2M']]
response = rd.content.ipa.financial_contracts.Definitions(
universe=definitions,
fields=[
'Isin',
'RIC',
'Cusip',
'Sedol',
'Ticker',
'CashFlowDatesArray',
'CashFlowInterestPercentsArray',
'CashFlowCapitalAmountsInDealCcyArray',
'CashFlowAnnualRatesPercentArray',
'CashFlowTotalPercentsArray']).get_data()
response.data.df0 -
Thanks @jonathan.legrand, I've got that working locally. My last bit of confusion is over the parameters. I want to get cashflows since the issue date for all bonds and had to use `bond.CalculationParams(market_data_date="2000-01-01")` in my initial example as proxy for this. I see with the new RD package that I can use `bond.PricingParameters(compute_cash_flow_from_issue_date=True)` but this sometimes doesn't return data for a bond (whereas using market_data_date does). Do you know why this might be happening?
See RIC code '21688AAQ5=BCLQ' as an example of this.
0 -
Hi @ed.jeffery,
Is this what you're after? I tried it after reading documentation:
definitions = [
rdf.bond.Definition(
instrument_code=i,
pricing_parameters=rdf.bond._bond_pricing_parameters.PricingParameters(
market_data_date="2000-01-01T00:00:00Z"))
for i in ['AU9YT=RR', '225401BB3=2M', '61772BAC7=1M',
'GR15YT=RR', 'AT7YT=RR',
'225401AY4=2M', '55608JBF4=2M',
'06406RBR7=2M', 'XS007437161=2M','FR001400I3N=2M']]
response = rdf.Definitions(
universe=definitions,
fields=[
'Isin',
'RIC',
'Cusip',
'Sedol',
'Ticker',
'CashFlowDatesArray',
'CashFlowInterestPercentsArray',
'CashFlowCapitalAmountsInDealCcyArray',
'CashFlowAnnualRatesPercentArray',
'CashFlowTotalPercentsArray']).get_data()
response.data.df0 -
Sorry if I wasn't clear. I am wondering why using the following parameter doesn't work?
compute_cash_flow_from_issue_date=True
i.e. setting a market data date of 2000-01-01 seems a hack to get it to work. I would expect setting the above parameter would return me cashflows from the issue date, but instead it returns nothing.
0 -
0
-
Hi @ed.jeffery,
Would you have a RIC example of an instument issued on 2000-01-01?
I'm asking becasue it looks like "21688AAQ5=BCLQ" was issued in 2021:0 -
Hi @ed.jeffery
You can use the parameter compute_cash_flow_from_issue_day = True
response = bond.Definition(
instrument_code="AU9YT=RR",
fields=[
'CashFlowDatesArray',
'CashFlowInterestPercentsArray',
'CashFlowCapitalAmountsInDealCcyArray',
'CashFlowAnnualRatesPercentArray',
'CashFlowTotalPercentsArray'],
pricing_parameters = bond.PricingParameters(
compute_cash_flow_from_issue_date = True )
).get_data()
response.data.raw0 -
21688AAQ5=BCLQ has already expired which you can check:
try:
response = bond.Definition(
instrument_code="21688AAQ5=BCLQ",
fields=[],
pricing_parameters = bond.PricingParameters(
compute_cash_flow_from_issue_date = True )
).get_data()
print(response.data.raw)
except rd.errors.RDError as e:
print("RDError code :", e.message)Therefore, you can set up a market date before the maturity to get all the cashflows
response = bond.Definition(
instrument_code="21688AAQ5=BCLQ",
fields=[ 'Isin',
'RIC',
'Cusip',
'Sedol',
'Ticker',
'CashFlowDatesArray',
'CashFlowInterestPercentsArray',
'CashFlowCapitalAmountsInDealCcyArray',
'CashFlowAnnualRatesPercentArray',
'CashFlowTotalPercentsArray'],
pricing_parameters = bond.PricingParameters(
compute_cash_flow_from_issue_date = True,
market_data_date="2024-01-09" )
).get_data()
response.data.raw0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛