Hello I am currently trying to retreive intraday data on python for DE3MT=RR but I get an error: . the code always worked, it is the second time i get this error. last time it got solved by simply rerunning the code. I can share the code and the error
import refinitiv.data as rd
from datetime import datetime
import warnings
import pandas as pd
CUT_OFF_DATE = pd.Timestamp("1999-01-01")
sy_de_ric = [
'DE3MT=RR',
'DE6MT=RR',
'DE1YT=RR',
'DE2YT=RR',
'DE3YT=RR',
'DE4YT=RR',
'DE5YT=RR',
'DE6YT=RR',
'DE7YT=RR',
'DE8YT=RR',
'DE9YT=RR',
'DE10YT=RR',
'DE15YT=RR',
'DE20YT=RR',
'DE30YT=RR'
]
Set Refinitiv API key
rd.open_session()
Set start and end date for data retrieval
end_date = datetime.now()
Set start date for every asset
start_date_sy_de = pd.Timestamp('1999-01-01', tz='UTC')
Get Daily Data from refinitiv
def get_daily_ric(ric_codes, start_date, end_date, fields=None):
"""
This function retrieves intraday quotes of a list of RICs from Refinitiv
Args:
ric_codes: list of RICs you want to download
start_date: start date of the range
end_date: end date of the range
fields: list of fields you want to retrieve
"""
data_list = []<br>
for ric_code in ric_codes:
# Get historical pricing data for the specified RIC code and time range
response = rd.get_history(universe=ric_code,
fields=fields,
interval="1d",
start=start_date,
end=end_date)<br>
response['#RIC'] = ric_code
data_list.append(response)<br>
# Appending data and cleaning
df = pd.concat(data_list, ignore_index=False)
df.reset_index(inplace=True)
df.rename(columns={'Date': 'Date-Time'}, inplace=True)
df['Date-Time'] = pd.to_datetime(df['Date-Time']).dt.strftime('%Y-%m-%dT%H:%M:%S.%f000Z')<br>
return df<br>
Get new intraday data from Refinitiv
sy_de = get_daily_ric(sy_de_ric, start_date_sy_de, end_date, fields=['TR.BIDYIELD', 'TR.ASKYIELD'])
response = rd.get_history(universe=ric_code,
File "C:\Mambaforge\envs\environment_mp_shocks_new\lib\site-packages\refinitiv\data_access_layer\get_history_func.py", line 206, in get_history
raise RDError(-1, except_msg)
refinitiv.data._errors.RDError: Error code -1 | Unable to collect data for the field 'TR.BIDYIELD' and some specific identifier(s). Requested universes: ['DE7YT=RR']. Requested fields: ['TR.BIDYIELD', 'TR.ASKYIELD']