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!

Best Answer

  • 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:

    image