question

Upvotes
Accepted
1 0 1 1

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()
...
datastream-apihistoricaldatastreamsymbol-list
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @gabrev ,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

Upvotes
Accepted
78.8k 250 52 74

@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.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 0 1 1

@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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@gabrev

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

1646811199043.png (9.1 KiB)

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.