Is it possible to retrieve government bond discount factors using Eikon APIs?
This seems to be possible using the RHistory function in Excel, but not using one of the Eikon APIs in Python. The get_timeseries does not provide discount factors.
Best Answer
-
You can install RDP Library by using this command:
pip install refinitiv.dataplatform
Then in your code, you can add this code, the RDP Library will connect to your Eikon Desktop(similar to Eikon Data API):
import refinitiv.dataplatform as rdp
rdp.open_desktop_session('<valid app key>')
df= rdp.get_historical_price_summaries('PLGOV1YZ=R', start='20210201', end='20210215')
display(df)0
Answers
-
I suppose what you would like to retrieve is timeseries of discount factors for various points on the zero curve derived from Treasuries, right? If this is the case, you can do this using RDP Libraries. Here's a the call using 10Y maturity point on US Treasuries zero curve.
rdp.get_historical_price_summaries('USGOV10YZ=R')
If you would like to retrieve something else, could you provide an example of RHistory function that retrieves the data you're interested in?
0 -
I have made a comparison in Excel for the 1Y Polish Government Bond rate (PLGOV1YZ=R). Retrieving both the discount factors and zero yields would result in the following:
Discount factor
Zero yield
When using the ek.get_timeseries() function in Python I am only able to retrieve the zero yields, which I can't transform to the discount factors (probably there is some smoothing involved). Are the discount factors available from the RDP library? What is the difference between the RDP.get_historical_price_summaries() function and the ek.get_timeseries() function?
0 -
The discount factor is available from the RDP Library.
The difference between EK vs RDP is:
- Eikon.get_timeseries can only retrieve "default" view data.
- RDP.get_historical_price_summaries can cover more views.
0 -
That is the solution I was looking for! Thanks for your help!
0 -
I should add to the answer by @chavalit.jintamalit that RDP Library for Python includes Eikon Data APIs as a module. Hence you can use both Eikon Data APIs and RDP Libraries methods from the same library. The following example uses Eikon Data APIs to retrieve the constituents of the Polish Treasuries zero curve, and then uses get_historical_price_summaries method of RDP Libraries to retrieve timeseries for the 1Y maturity point on the curve.
import refinitiv.dataplatform as rdp
import refinitiv.dataplatform.eikon as ek
rdp.open_desktop_session('MY_APP_KEY')
tmp_df, err = ek.get_data('0#PLXZ=R',['TENOR'])
df= rdp.get_historical_price_summaries(
tmp_df.loc[tmp_df['TENOR']=='1Y','Instrument'].iloc[0],
start = '20210201',
end = '20210215')
display(df)0
Categories
- All Categories
- 6 AHS
- 39 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
- 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 中文论坛