I'm struggling with how to correctly feed a list of strings one-by-one into a pre-defined function. The list looks like this:
riclist = ["XAU=", "XAG=", "XPT=", "XPD="]
And the function looks like this (note that ek.get_timeseries is a pre-defined function from the Eikon library, but this problem could be generalized to any similar one):
def get_variable(input):
chosenric = riclist[ ##each item one-by-one## ]
var = ek.get_timeseries(rics=chosenric,
start_date=2018-01-01,
fields="CLOSE")
return(var)
And the end result I'm after is a DataFrame with the time-series for all n variables in riclist.