For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

EikonError: Error code -1

When trying to get monthly close data on a list of rics (600 stocks) by running the following,

I get the following error,

Can anyone help me addressing this error code -1?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
1584100180700.png (24.5 KiB)
1584100256195.png (27.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvote
Accepted
18k 21 12 20

Hi @oscar.moegelmose

You can use try / except block.


Here is the modified code:

df,e = ek.get_data('0#.FTAS','TR.RIC')
rics = df['Instrument'].tolist()
# stock_name = 621 RICs

data_set = None
count = 0
error_ric = []
for stock_name in rics:
    count+=1
    try:
        stock_data = ek.get_timeseries(stock_name,start_date='2000-01-01',end_date='2020-01-01',
                                       fields='*',interval='monthly',corax='adjusted')
        stock_data.columns = pd.MultiIndex.from_product([[stock_name], stock_data.columns])
        time.sleep(1.3)
        if data_set is None:
            data_set = stock_data
        else:
            data_set = pd.concat([data_set,stock_data], axis=1)
        print(count,'/',len(rics),' ', stock_name, ' = ', len(stock_data))
    except ek.EikonError as err:
        print(count,'/',len(rics),' ', stock_name, ' = ERROR')
        error_ric.append(stock_name)

And here is the error handling.


ahs.png (83.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea