get_timeseries doesn't start from the date I put - Eikon API python

I only get data from 4/2/2019 to today, but I was asking for data from 1/1/2007 to today.

this is my code:

iso =['AT','BE','BG','CH','CY','CZ','DE','DK','EE','ES','FI','FR','GB','GE','GR','HR','HU','IE','IS','IT','LT','LU','LV','MT','NL','NO','PL','PT','RO','RS','RU','SE','SI','SK','TR','UA'] 
iso[:]=[x + "5YT=RR" for x in iso]
sovereign=ek.get_timeseries(iso , fields=['CLOSE'], start_date ='2007-01-01', interval='daily')

Any suggestions?
Thanks

Best Answer

  • Hi @derivato

    You can try with ek.get_data like the example below:

    iso =['AT','BE','BG','CH','CY','CZ','DE','DK','EE','ES','FI','FR','GB','GE','GR','HR','HU','IE','IS','IT','LT','LU','LV','MT','NL','NO','PL','PT','RO','RS','RU','SE','SI','SK','TR','UA'] 
    iso[:]=[x + "5YT=RR" for x in iso]
    sovereign = ek.get_data(iso,["TR.BIDYIELD.date","TR.BIDYIELD"], {"Sdate":'2007-01-01','EDate': 0,})[0]
    sovereign

Answers

  • it gives me a different structure but there seem to be everything - thanks a lot

  • Just a quick clarification: what's the meaning of the final [0]?

  • Hi @derivato

    ek.get_data returns a tuple of a pandas.DataFrame and an Error object.

    You can also do it this way:

    sovereign, err = ek.get_data(iso,["TR.BIDYIELD.date","TR.BIDYIELD"], {"Sdate":'2007-01-01','EDate': 0,})
    sovereign