Data missing for ek.get_timeseries ,asking for solution!

df1.zip

when I try to get data from Python API , I met data missing problem ,the code is pasted below.

import eikon as ek
import pandas as pd
import time
ek.set_app_id('ED142B67FBF0B94BAC3AB')

start=time.strftime("%Y-%m-%dT01:30:00",time.localtime(time.time()))
end=time.strftime("%Y-%m-%dT07:00:00",time.localtime(time.time()))

ss=pd.read_csv('ss.csv')
ss.columns=['ss']
ss1=ss.values.tolist()
sslist=list(ss.ss)
s1=sslist[:300]

df1=ek.get_timeseries(s1,fields=["Open","High","Low","Close","Volume"],
start_date = start,end_date =end,interval='minute')






The attachments include 2 files, ss for the code list, df1 is the result.

Obviously, there is data missing occurred in the df1.

Best Answer

  • I think that it reached the limit as mentioned in this question.

    If I reduce the number of items to 200, I can get the data properly.

    s1=sslist[:200]

Answers

  • When I run your code, I have following error from Timeseries service:

    ('600005.SS', ': ', 'Error: TSIUnknownInstrument, ErrorCode: TA-TSIUnknownInstrument, Fault: TSIError, Description: Invalid RIC', '\n')
    ('600074.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600084.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600145.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600146.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600150.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600161.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600162.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600187.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600199.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600209.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600227.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600239.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600242.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600248.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600257.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600267.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600273.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600289.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600311.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600328.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')
    ('600332.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')

    That means 600005.SS RIC doesn't exist and there is no data available in the time range for all others ('600074.SS','600084.SS','600145.SS','600146.SS','600150.SS','600161.SS', '600162.SS', '600187.SS', '600199.SS', '600209.SS', '600227.SS', '600239.SS', '600242.SS', '600248.SS', '600257.SS', '600267.SS', '600273.SS', '600289.SS', '600311.SS', '600328.SS', '600332.SS')

    Do you have the same result ?

  • Yes,you got the right data, my code list include some delisting stock ,that's the problem.

    The problem is for the available RIC, for example, 600004.SS , do u get the miss data problem?

  • I guess you r right :(, maybe it's too many data...

  • I hope I can get the official answer, indeed ,how much data should i get one time

  • The official limit for timeseries is 3000 datapoints whatever the number of RIC.
    When you need to retrieve data for many RICs, you should slice identifier list and send several requests.

  • jirapongse.phuriphanvichai

    I saw your link for this question. but I have some doubt for this.

    Could you help explain the means for 3000 points limitation.

    Is it means that we can't get data more than 3000 at one time ?

    If store data to excel, it's limit to get 3000 cell data at a time?

    Thanks very much

  • @Baoping.Lv

    From my test, each interval has its own limitation. For daily historical data, its limit is 3000 entries.

    For example, if I request daily historical data of IBM.N from year 2000 to 2017, the returned data will only have 3000 rows from year 2005 to 2017.

    f = ek.get_timeseries(['IBM.N'],['OPEN','CLOSE'],start_date='2000-10-25T00:00:00',end_date='2017-10-25T00:00:00',interval='daily')
    df.to_csv('IBM.csv')

    image

    However, if I request two RICs, the returned data will have 1500 entries for each RIC.

    df = ek.get_timeseries(['IBM.N', 'TRI.N'],['OPEN','CLOSE'],start_date='2000-10-25T00:00:00',end_date='2017-10-25T00:00:00',interval='daily')
    df.to_csv('IBM_TRI.csv')

    image