I am trying to extract FX data on different currencies with different maturities. I have a list that contains all the currency pairs and their respective maturities. This means that I have to retrieve a vast amount RICs, over 2000 to be specific. Is there a way to retrieve a large amount of RICs?
@benjamin.lian So it depends on the amount of data fields you wish to download per RIC and whether you are using get_timeseries or get_data API calls. Either way information on our API limits can be found here. Usually one would break a large RIC list into chunks using something like:
def chunks(l, n): for i in range(0,len(l),n): yield l[i:i+n]
rics = list(chunks(list(large_ric_list), 50))
Which could break a large list of RICs into chucks of 50 RICs - which could then be iterated over to stay within API datapoint per call limits. I hope this can help.
@benjamin.lian So if you need a list of forward/depos rics you can try some chain RICs such as :
df,err = ek.get_data(['0#GBPF='],['CF_NAME']) df
Which can give you a list of instruments across delivery periods. Or once you know the pair and the delivery period you can mechanically build these - using :
and the formula:
I hope this can help.