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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
98 10 21 27

Avoid Eikon from giving the last available value for a date outside of a request.

Doing a follow-up to a question I posted couple of days ago (which you can see here), I want to know how to avoid Eikon from giving me data of unsolicited dates when it doesn't find anything on the dates I request.

If you haven't seen my post, let me explain myself in a more detailed way:

I have a list of identifiers for companies in the US, I want to get the daily returns of those companies for a given range of dates. For some companies I'm getting back returns for dates I did not request, but is giving me the last date available previous to the interval of the request.

Is there a setting I can turn on/off in order to avoid Eikon to stop doing this?

Thanks for your time!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
38.1k 71 35 53

You can try to use a "TR.TotalReturn.calcDate" field instead.

df = ek.get_data(identifiers, 
                 ["TR.TotalReturn.calcDate","TR.TotalReturn",],
                 {'SDate': row_dates[0], 'EDate': row_dates[len(row_dates)-1], 'Frq':'D'})[0];
df=pd.crosstab(df.Instrument, df['Calc Date'],values=df['Total Return'], aggfunc='mean')

It returns:


calcdate.png (26.2 KiB)
icon clock
10 |1500

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

Click below to post an Idea Post Idea