Efficient retrieval of a series of returns data around a date
Hi, my question is about what is an efficiency way of doing this:
Let's say I have a particular date of interest for a RIC, and I want to get 1) the daily total returns for -1 to 1 days around this date and 2) the total return from this date to 30 days after this date.
For now I am retrieving every return data separately by
#for the daily return from -1 to 0
=eikon.get_data([RIC,['TR.TotalReturn'], {'SDate':datetime.strftime(Date - timedelta(1), '%Y-%m-%d'), 'EDate':datetime.strftime(Date - timedelta(0), '%Y-%m-%d')})
This appears very inefficient when I have many of such dates of interest from many RICs, not to mention the Error 400 warnings. Just wonder if anyone have a clever way?
Best Answer
-
Hi @chen.lin
First, I would like to mention that get_data can take in multiple RICs as input. This may reduce your API call if you only pass in a single RIC.
Second, It really depends on the dates of your interest. So you can consider retrieving a range of data and filter them out on your dataframe.
Just make sure that it does not exceed the limitation which explained here.
0
Answers
-
Hi, many thanks, that's exactly what I tried later on and it worked nicely for my tasks
However, there's one minor bug I want to report and an additional question about the limits.
For some RICs, I get duplicated observations, as in the example below:
data_grid, err = eikon.get_data('1992.T',
fields = ['TR.TotalReturn1D.date','TR.TotalReturn1D'],
parameters={'SDate':'1991-09-01','EDate':'2019-12-01','Frq':'D','CH':'Fd'})You can immediately spot them
It's not hard to fix this once you are aware, but might be a problem if someone else does not. And it seems this is not an issue when I run the formula in excel add-in.
And just of curiosity, for that same code, I tried to used up to 20 RICs as input and obtained a matrix of size 113,852 X 3. How is that not restricted by the limit of 10,000 data point?
0 -
Hi @chen.lin
I tried using Eikon Excel to retrieve the same RIC and date range data.
I can see the same identical data.
So this should be a content issue.
Refinitiv Helpdesk can help to clarify if there is any content issue or can explain why you get duplicated records.
You can raise query to them at https://my.refinitiv.com/
1
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 162 App Studio
- 4 Block Chain
- 5 Bot Platform
- 17 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 中文论坛