I am trying to download Russell 2000 stocks(and other lists) for backtesting with dead stocks too.
I use Python Datastream API. I start from 1990 and get the list of constituents then download them.
For most of the lists I only get N/A so no stocks.
Only for a list: LFRUSS2L I get stocks but they are less than 2000 !
I attach my code.
Thanks Gabriel
The code I use:
... mlist = set() mmyy_list = [] for yea in range( 60, 122): for mo in range(1 , 13): yea2 = yea if yea2 > 99: yea2 -= 100 stri = str(yea2).zfill(2) + str(mo).zfill(2) mmyy_list.append(stri) print(' ***** STARTING ' + symb) ds = dsws.Datastream(username=user, password=pw) # call Datastream to get RICs list rics_list = {} for mmyy in mmyy_list: reque = symb + mmyy + '|L' try: dat = ds.get_data(tickers=reque, fields=['MNEM'], kind=0) # print(dat) # save rics list in python dict rics_list = dat['Value'].tolist() ...