Hi, I want to download time series data for government and corporate bond yields. I found the scr...

Best Answer
-
The get_historical_price_summaries does not support multiple instruments.
You can make a loop in your code:
0
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
- 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 中文论坛