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
98 27 33 35

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-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.

1 Answer

· Write an Answer
Upvotes
Accepted
79.2k 251 52 74

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 512.0 KiB each and 1.0 MiB total.

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.