EIKON API: Incorrect output when start_date is before first trade date

Hi, I try downloading historical market cap values for some companies. I noticed when the start_date is before the first trading date, all data seems to be incorrect. For examples:

import_symbols ="AAC.N"
start_date = "20141001"
end_date="20141006"
field_name = "TR.COMPANYMARKETCAP"
df_a, error = eikon.get_data(import_symbols, [field_name, field_name + ".DATE"],
{"SDate": start_date, "EDate": end_date}, field_name=True)
df_a

The output is:

image

While if I use the following code:

import_symbols ="AAC.N"
start_date = "20141002"
end_date="20141006"
field_name = "TR.COMPANYMARKETCAP"
df_a, error = eikon.get_data(import_symbols, [field_name, field_name + ".DATE"],
{"SDate": start_date, "EDate": end_date}, field_name=True)
df_a

The output is as follows:

image

I think this applies to more columns than just market cap.

I assume the latter is correct? What would be the best way to get the correct data?

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @sim19

    It is a known bug that the API doesn't handle NULL data properly. The NULL data is replaced with the next available data which causes the data is shifted upward.

    If you use Eikon Excel with the same formula, the Company Market Cap on 1 Oct 2014 is NULL.

    image

    However, with Eikon Data API, the NULL data (data of 1 Oct 2014) is replaced with the next available data (data of 2 Oct 2014).

    image

    For more information, please refer to this question.

Answers