Hi, I want to download time series data for government and corporate bond yields. I found the screen
Best Answer
-
The get_historical_price_summaries does not support multiple instruments.
You can make a loop in your code:
1
Answers
-
Here's a quick example
import refinitiv.dataplatform as rdp
rdp.open_desktop_session('USE_YOUR_APP_KEY_HERE')
rdp.get_historical_price_summaries(
universe = '345370BR0=',
start = '2020-12-10',
end = '2020-12-26',
fields=['MID_YLD_1'])For more examples see Jupyter notebooks demonstrating Historical Pricing under RDP Library examples in Refinitiv API Samples repository on Github.
0 -
Hi Alex, thank you for the answer
Just want to comment that I run the code and it seems that it is executed however I do not see any output.
I also run the code in Jupiter and the output was presented
Should I run any other command?
Thank you in advance
0 -
Jupyter (or rather IPython) by default displays the results of the execution of the last line of code in the cell. Other Python interpreters, like the one used by Spyder, don't do that. With regular Python interpreter, to display any output on the screen, you need to explicitly include this action in your code. E.g.
df = rdp.get_historical_price_summaries(
universe = '345370BR0=',
start = '2020-12-10',
end = '2020-12-26',
fields=['MID_YLD_1'])
print(df)0 -
Thank you for your answer. The code works well. How can I obtain data for multiple series in universe e.g.
universe = '345370BR0= 'GR176298006= and so on. Thank you
0 -
Thank you for your answer. The code works well. How can I obtain data for multiple series in universe e.g.
universe = '345370BR0= 'GR176298006= and so on. Thank you
0 -
Thank you for the response! It works!
0 -
Hi,
In relation to a previous comment, how can I download the output data into an excel? For example the first column dates, the second column the MID_YLD_1 for the first RIC, the third column the MID_YLD_1 for the second RIC, and so on.
Thank you in advance,
0 -
get_historical_price_summaries method of RDP library can only retrieve one instrument at a time. To retrieve timeseries for multiple instruments you need to do it sequentially, one instrument at a time.
0 -
If you have a new question, it is advised to start a new question.
To export dataframe to excel file, you can refer to the sample on this page.
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_excel.html
0 -
If you'd like to save the data you retrieved in Python as a file you can open in Excel, use to_excel or to_csv method of pandas library, as @chavalit.jintamalit said. And if you'd like to retrieve the data directly into Excel, use RHistory worksheet function provided by Eikon Excel add-in, e.g.
=RHistory("345370BR0=","MID_YLD_1.Timestamp;MID_YLD_1.Close","INTERVAL:1D",,"CH:Fd")
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 中文论坛