NA response while downloading lists

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()
...

Best Answer

  • @gabrev

    The code looks incorrect. The date format is "mmyy" but the code creates dates in the "yymm" format. Please use the below code.

    stri = str(mo).zfill(2) + str(yea2).zfill(2)

    For the N/A issue, please contact the Refinitiv Datastream Web Service support team directly via MyRefinitiv to verify the content.


Answers

  • @Jirapongse @raksina.samasiri
    Thank you very much. Now it works better.
    I copied that part of the code from this forum and I did not notice the month/year swap...
    However downloading Russell 2000 constituents I get the following results:
    - using LFRUSSL2:

    {NA} in all responses from 1960
    - using LFRUSS2L:
    the list is downloaded but I get only 1440 stocks

  • @gabrev

    Please contact the Refinitiv Datastream Web Service support team directly via MyRefinitiv to verify the content.

  • hi @gabrev ,

    Ticket ID 11022779 was raised on your behalf to verify the content, support team is going to reach you directly. Hope this could help.

    Plus, as this thread is already closed (have the accepted answer) so it won't be monitored anymore, if you have any further questions, please raise a new question.