Im trying to retrieve historical prices for bonds on refinitiv eikon for around 500 bonds, however the code Im trying its not working:
"...
dataframes = {}
for isin in isin_numbers:
try:
# Fetch the issue date
df_issue_date, err = ek.get_data(isin, ['TR.FiIssueDate'])
issue_date = df_issue_date['Issue Date'][0].strftime('%Y%m%d')
df, e = ek.get_data(isin, ['TR.ASKPRICE(SDate=' + issue_date + ', EDate=20230531,Frq=D).date','TR.BIDPRICE(SDate=' + issue_date + ', EDate=20230531, Frq=D)','TR.ASKPRICE(SDate=' + issue_date + ', EDate=20230531, Frq=D)'])
dataframes[isin] = df
except:
print(f"No data available for ISIN: {isin}")
# Concatenate all dataframes into a single dataframe
df_all = pd.concat(dataframes.values())
I would highly appreciate your help.
Thanks a lot