calcdate not equal for all fields in eikon api

I would like to have historical values for closing price and target price per trading date. I run the following code:

start_date = datetime.datetime.now().strftime("%Y%m%d")
start_date = str(20071113)
end_date = str(20071108)
chunk = ['IBM']
fields = ['TR.CLOSEPRICE','TR.CLOSEPRICE.calcdate','TR.PRICETARGETMEAN', 'TR.PRICETARGETMEAN.calcdate']
data, error = eikon.get_data(chunk, fields,
{"SDate":start_date, "EDate":end_date, "frq":"D"})
data

Unfortunately, the calcdates do not allign (20071112 is missing for PRICETARGETMEAN). Is there a way to make sure the calcdates are always equal for all columns?

Best Answer

  • Alex Putkov.1
    Alex Putkov.1 ✭✭✭✭✭
    Answer ✓

    The way this is solved in Excel is through RH:Date parameter, which adds the master date row headers to the return table. Unfortunately at the moment there's no equivalent in Eikon Python API. Thomson Reuters is looking at ways to address this deficiency. In the meantime merging the dataframes as advised by Joris is all I can suggest as a workaround.

Answers