I was trying to get the largest 10 companies with respect to the market cap each year for a list of countries over a particular time period. I use a loop like this:
country = ["IR","NL"]
for i in country:
for j in range(2000,2006,5):
Start=str(j)+'-12-31'
instruments = 'SCREEN(U(IN(Equity(active or inactive,public,primary))),IN(TR.ExchangeCountryCode, i),TOP(TR.CompanyMarketCap(SDate=Start), 10, nnumber), CURN=USD)'
field = ["TR.CommonName"]
df,err = ek.get_data(instruments, field)
But in the loop, the "i" is not recognised as item in the country list and the "Start" is not recognised as the variable created within the loop.
Any solution for the problem? or is there a better way to obtain the requested RIC codes?
Thank you.