vfilimonov / pydatastream

Python interface to the Refinitiv Datastream (former Thomson Reuters Datastream)
MIT License
71 stars 30 forks source link

Issues with Pulling Historical Constituent Lists #23

Closed SheikhYabouti closed 4 years ago

SheikhYabouti commented 4 years ago

I'm having trouble pulling historical constituent lists for S&PCOMP. Regardless of the date requested, it always returns a current constituent list.

For example:

DS.get_constituents('S&PCOMP', '1-9-1980')

returns a dataframe including Netflix.

I am very new to Python/GitHub so I may just be doing it wrong. If so I would very much appreciate if you could point me to some documentation.

vfilimonov commented 4 years ago

Hello @SheikhYabouti

thank you for reporting this!

Apparently the functionality/request format was changed when Datastream migrated from DWE to DSWS platforms.

Unfortunately at the moment I don't have access to Datastream myself. So let me ask your help in resolving this. You could check here (http://product.datastream.com/dswsclient/Docs/TestRestV1.aspx) whether it is a library issue or the server issue.

You will need a token, e.g. from the library by executing:

DS = Datastream(username, password)
print(DS.token)

fill the form like on the screenshot below (note: "Snapshot" kind and ticker "LS&PCOMP") and click "execute":

Screenshot 2019-11-29 at 22 14 18

If the response is similar to what you get in python (i.e. with Netflix, Amazon, Alphabet etc.) then let me ask you to contact the support, asking what should be the correct request to get the historical lists.

I would be then happy to fix it in the library!

SheikhYabouti commented 4 years ago

Thanks for the response! I did what you recommended re: the Test REST Service and received the same current listing as before. I have opened a support ticket with Refinitiv and will let you know the response from them when I get it.

SheikhYabouti commented 4 years ago

I went back and forth with customer support and it turns out they have discontinued historical constituent lists. The last email from them reads:

Yes there is no current support or way to get historical data for constituent lists and sad to say there is no alternative or other option for it.

I have confirmed that even my old Excel files are unable to grab historical constituent lists (I'm trying to replace them with Python atm). Since I haven't done a historical data series in a while it slipped my notice.

vfilimonov commented 4 years ago

Hello @SheikhYabouti ,

thanks a lot for confirming!

It is extremely disappointing indeed - historical constituent lists are crucial for cash equity backtests..

I will then remove this option from the library and docs.

vfilimonov commented 4 years ago

I've updated the readme and code in master. Hope that at some point DSWS will bring back historical lists as well

Meanwhile - closing the issue..