Eikon API
Python
Windows
df = ek.get_timeseries(ric, start_date=start_date, end_date=end_date, fields='Close')
This request fails frequently leading to missing data, I either get "Error code 2504 | UDF Core request failed. Gateway Time-out" or "Error code 500 | Backend error. 500 Internal Server Error".
I have tried slowing down the request frequency and also handling the errors to create the request again so that the data doesn't get missed but this does no work.
Passing a list of RIC codes seems to work better but there appears to be a limit on the date range meaning the I cannot get the length of time series I need.
This is the function used and I am passing in a list of RICs for FX rates, gas settlement, Brent settlement, Power settlement and EUA settlement.
def produce_settlement_df(RICs, start_date, end_date):
for ric in RICs:
try:
if RICs.index(ric) == 0:
df = ek.get_timeseries(ric, start_date=start_date, end_date=end_date, fields='Close')
df = df.rename(columns={"CLOSE": ric})
else:
temp_df = ek.get_timeseries(ric, start_date=start_date, end_date=end_date, fields='Close')
temp_df = temp_df.rename(columns={"CLOSE": ric})
df = df.merge(right=temp_df, how='outer', left_index=True, right_index=True)
except ek.EikonError as e:
print(e)
print(ric)
return df