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 -
I also have about 800 active bonds that I can't get data for via the RD package and the API doesn't provide any information on why they are missing. How can I send a list of the bonds so that Refinitiv can investigate?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.raw1 -
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.raw1
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 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
- 367 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
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛