vfilimonov / pydatastream

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

How to request several tickers at once #16

Closed cerezoafc closed 6 years ago

cerezoafc commented 6 years ago

I want to request several tickers at once, for instance US and Spain's GDP. I have no problem requesting each series one by one. but when I add a list of tickers, I get an error message. I cannot add a "field" because these series have no available field in Datastream, as far as I know.

from pydatastream import Datastream DWE = Datastream(username='DS:XXXXX', password='XXXXX') DWE.fetch(['ESXGDPR.D','USGDP...D'], date_from='1980-01-01')

invalid value encountered in absolute inside = ((abs(dx0 + dx1) + abs(dy0 + dy1)) == 0) Traceback (most recent call last):

File "", line 1, in gdp = DWE.fetch(['ESXGDPR.D','USGDP...D'], date_from='1980-01-01')

File "C:\Python27\lib\site-packages\pydatastream\pydatastream.py", line 513, in fetch dat, meta = self.parse_record(raw, indx)

File "C:\Python27\lib\site-packages\pydatastream\pydatastream.py", line 295, in parse_record status['StatusMessage'], status['Request']))

DatastreamException: Failure (error 2): $$"ER", E100, INVALID CODE OR EXPRESSION ENTERED, USGDP...D(P) --> "ESXGDPR.D,USGDP...D~1980-01-01~D"

Thank you

vfilimonov commented 6 years ago

This is a duplicate of https://github.com/vfilimonov/pydatastream/issues/11 (https://github.com/vfilimonov/pydatastream/issues/14 is also relevant).

Please see Note 1 in README.md for the explanations.

With respect to the GDP - you could try "ES" or "ESA" fields.