Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 0

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?



eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @Alex Putkov. , @chavalit.jintamalit, @jirapongse.phuriphanvichai

Could you look into this question?

<AHS>

Hello @chavalit.jintamalit @Alex Putkov.

Could you please help the client regarding this Eikon data api question?

Hello @chen.lin

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
18.2k 21 13 21

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.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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?



capture.jpg (79.8 KiB)

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/

ahs.png (50.4 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.