Bond calculator - cash flow
How is it possible to create the "norm factor" and "residual amount usd" column in bond calculator cash flow section using Eikon API or codebook? If so, is it possible to have these columns for multiple bond ISINs?
Best Answer
-
Hi @asli.sahin,
For such information, I would advise using the IPA service. You can reach it in Python in CodeBook if needed. For more information on it, please see:
Bond Contracts: Documentation | Devportal (lseg.com)
Cash Flow Definitions: Documentation | Devportal (lseg.com)
A example showcasing IPA at play can be found on CodeBook under:__Examples__/03. Quantitative Analytics/03.03. Bonds/Bond_Pricing.ipynb
0
Answers
-
Hi Thanks,
With the IPA financial contracts page I checked bonds: https://developers.lseg.com/en/api-catalog/refinitiv-data-platform/refinitiv-data-platform-apis/documentation/manuals-and-guides/ipa-financial-contracts/ipa-financial-contracts---bond-contracts
But find it hard to understand where to find these two columns : Norm. Factor and Residual Amount USD.
Below excel, it is possible to bring the data with the underlined formula.
Thanks.
0 -
It should be this code.
response = bond.Definition(
instrument_code = 'US1536637036',
fields = [
"CashFlowDatesArray",
"CashFlowResidualAmountsInDealCcyArray"
]
).get_data()
response.data0 -
Thank you. With your example, it bring the below.
Am I missing something here? Thank you.
0 -
It returns the raw json response so you need to reformat it. For example:
response = bond.Definition(
instrument_code = 'US1536637036',
fields = [
"CashFlowDatesArray",
"CashFlowResidualAmountsInDealCcyArray"
]
).get_data()
dict = {response.data.raw["headers"][0]["name"]: response.data.raw["data"][0][0], response.data.raw["headers"][1]["name"]: response.data.raw["data"][0][1]}
df = pd.DataFrame(dict)
dfThe output is:
0 -
Hi, Many thanks.
If this was for a group of bonds. How can we adjust the code please?
I tried a few variations but it didn't work. Many thanks.
0 -
Also, if I would like to add the below in excel, how would the code be?
0 -
@asli.sahin
Please share the code you are using.
0 -
It is similar to the rd.get_data method.
rd.get_data(["153663703="],["TR.REDAMT"])
Or,
rd.get_data(["153663703="],["TR.REDAMT"],
{"SDate":"","EDate":""})You can use the Data Item Browser tool to check for fields and parameters.
0 -
Hello, how would the code change if it is for multiple instruments? Could you please share an example with multiple instruments?
Many thanks.0
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 中文论坛