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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
0 0 2 0

Error with get_timeseries

Hi Gurpreet.

After posting a thread the button to edit dissapears after a few minutes and there is no button to answer, so in practice the thread is closed and I can't answer anywhere to your comments. That is why I open a new thread with my code. In case it is possible to answer a thread, Can you tell me how?


The file 2acciones simply contains one column with ACCIONES in the first cell and all the RICS of an exchange below. I tried .SPX and others but all crashed below 200 stocks. I was not able to download the S&P 500 for example.

(edit: I got two different errors, I upload the error messages)



I add the error code, apparently the RIC giving problems was ISX.AX:


2020-04-22 20:46:41,379 P[15208] [MainThread 18380] Error with ISX.AX: No data available for the requested date range


2020-04-22 20:46:41,379 P[15208] [MainThread 18380] ISX.AX: No data available for the requested date range | 


Traceback (most recent call last):   File "C:/ES.py", line 17, in <module>  resultado = ek.get_timeseries(j, start_date = fecha_inicio, end_date = fecha_fin, interval="minute",fields= ["HIGH", "LOW", "OPEN", "CLOSE", "VOLUME"] ) 


File "C:\User ikon\time_series.py", line 198, in get_timeseries    

raise EikonError(-1, message=ts_error_messages) eikon.eikonError.EikonError: Error code -1 | ISX.AX: No data available for the requested date range | 


I get a different error, I add here what I get, no idea what this error is:


Traceback (most recent call last):
  File "C:/Users  RENTES.py", line 22, in <module>
    resultado.to_csv (filename, index = True, header=True, decimal=',')


  File "C:\Users\ pandas\core\generic.py", line 3228, in to_csv
    formatter.save()


  File "C:\Useges\pandas\io\formats\csvs.py", line 183, in save
    compression=self.compression,


  File "C:\Users\santi\PycharmProjects\oanda\venv\lib\site-packages\pandas\io\common.py", line 399, in _get_handle


    f = open(path_or_buf, mode, encoding=encoding, newline="")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\ api\\PRN.AXresultado.csv'




This is the code I use to download the info:



 import eikon as ek


 import time 


ek.set_app_key('some number") 


a = pd.read_csv("2acciones.csv") 


lista = a['ACCIONES'].to_list() 


for j in lista:

fecha_inicio = "2020-02-23"


fecha_fin = "2020-04-20"

resultado = ek.get_timeseries(j, start_date = fecha_inicio, end_date = fecha_fin, interval="minute",fields= ["HIGH", "LOW", "OPEN", "CLOSE", "VOLUME"] ) 


filename = (r"C:\ some direction api\{}resultado.csv".format(j)) 


print (resultado) 


resultado.to_csv (filename, index = True, header=True, decimal=',') 



time.sleep(1) 
eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
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.

Upvotes
Accepted
39.2k 75 11 27

@arnoldpredator

  1. The error "ISX.AX: No data available for the requested date range" is self explanatory. The shares of iSignthis Limited (ISX.AX) have been suspended from trading on Australian Securities Exchange since October 2019. There are no trades recorded for this stock for the requested period of 2020-02-23 - 2020-04-20.
  2. FileNotFoundError occurs when you're trying to save a dataframe to a csv file. This error has nothing to do with Eikon. I'm afraid you need to troubleshoot it yourself. The moderators on this forum cannot help you with this. All I can say is that the line
filename = (r"C:\ some direction api\{}resultado.csv".format(j)) 

looks awkward to me. It appears you're specifying a folder name that starts with a white space, and on Windows folder names cannot start with a space.

3. "Interval is not supported" - please provide details about the error including a full traceback.

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.

Upvotes
0 0 2 0

There is a third different error saying "Interval is not supported |·"

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