ek.get_timeseries() miss lots of timesptes

hi

I am trying to get historical price of a list of RICS from 2000-01-01 to 2004-12-31.

But returned data only start from 2004-05-28.

Get_timeseries() function didn't throw any error and this happens every time when passing a list of RICS.

All the history price of all RICS in the list can be found in eikon desktop up to 2000. But even if they can't be found, shouldn't they be filled with nan?

image

image

BTW, may I ask what does 'expired' means in index joiner/leaver list. For example, JC penny is indicated as expired in s&p500 list. I cannot find any price information of this stock on eikon, but it is still publicly traded and price history can be found on yahoo finance.

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @cqlc94

    The get_timeseries method has limitations, as mentioned in the EIKON DATA API USAGE AND LIMITS GUIDELINE.

    get_timeseries: The current limit value (10-Oct-2019) is 3,000 data points (rows) for interday intervals and 50,000 data points for intraday intervals. This limit applies to the whole request, whatever the number of requested instrument. 

    Your request hits 3,000 data points which is a limitation of interday interval.

    To get all data, there are two options.

    1. Using the get_data method to get time-series data

    df, err = ek.get_data(['IBM.N'],['TR.OPENPRICE.Date','TR.OPENPRICE','TR.CLOSEPRICE'],
                          {'Sdate':'2000-01-01', 'EDate':'2004-12-31','Frq':'D'})

    2. Using the get_timeseries method with multiple requests. For example, the below code uses multiple get_timeseries requests by splitting requests by start_date and end_date.

    import datetime
    import math

    ic, err = ek.get_data('.GDAXI','TR.IndexConstituentRIC(SDate=2016-12-31)')
    riclist = ic['Constituent RIC'].tolist()


    startDate = datetime.datetime(2016, 12, 31)
    numberOfDays = math.floor(3000 / len(riclist))
    endDate = startDate + datetime.timedelta(days=numberOfDays)
    #print(startDate, endDate, numberOfDays)
    field_list = ['OPEN', 'CLOSE']
    df = []
    while startDate < datetime.datetime.now():
        #print(startDate, endDate)
        hist = ek.get_timeseries(riclist,fields=field_list, interval='daily',start_date = startDate, end_date=endDate)
        df.append(hist)
        startDate = endDate + datetime.timedelta(days=1)
        endDate = startDate + datetime.timedelta(days=numberOfDays)
        if endDate > datetime.datetime.now():
            endDate = datetime.datetime.now()

    result = pd.concat(df)
    result

Answers

  • Thanks for the information about limitations.

    I have tried ek.get_data(), but it returns a df with data points beyond end date.

    (I could simply drop them, but its nice to know what went wrong)

    image

  • @cqlc94

    You need to use 'TR.PriceOpen.Date' instead of 'TR.OPENPRICE.Date'.

    image