Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Economics data #11

leocaza opened this issue Jun 2, 2017 · 3 comments


Copy link

commented Jun 2, 2017


I'm trying
DWE.fetch(["BHWDA347A","BHWDM8P5A"], date_from='2009', date_to='2016')

I get
DatastreamException: Failure (error 2): $$"ER", E100, INVALID CODE OR EXPRESSION ENTERED, BHWDM8P5A(P) --> "BHWDA347A,BHWDM8P5A2009-01-01:2016-01-01~D"

But i know that individually, it works well :
DWE.fetch(["BHWDA347A"], date_from='2009', date_to='2016')
DWE.fetch(["BHWDM8P5A"], date_from='2009', date_to='2016')

What am i doing wrong?

My goal:
I would like to do one request with a list of 10 series instead of looping 10 series on 10 rows (with for i in range(1,10)... I'm sure it will be faster with one single request


This comment has been minimized.

Copy link

commented Jun 5, 2017


Unfortunately I could not help you here and perhaps you should ask Thomson Reuters service desk about the correct request format for fetching multiple economic indicators at once. The error which you see is coming from the Datastream server, and I'm confused as well, why the individual symbols are fetched correctly (Request:BHWDA347A~2009-01-01~:2016-01-01~D), but two of them are not (Request:BHWDA347A,BHWDM8P5A~2009-01-01~:2016-01-01~D).

From another hand, if you need only ~10 indicators, then a simple loop is not a big problem at all:

import pandas as pd
pd.DataFrame({_:DWE.fetch(_, date_from='2009', date_to='2016')['P'] 
              for _ in ["BHWDA347A","BHWDM8P5A"]})

p.s. If you set DWE.show_request = True then you'll be given the requests used in each case.



This comment has been minimized.

Copy link

commented Jun 18, 2017

I'm closing this for now.

@vfilimonov vfilimonov closed this Jun 18, 2017


This comment has been minimized.

Copy link

commented Nov 3, 2017

There're some more context to the issue: #14

"P" here is considered as a mnemonic for API, when for economic series it does not exist. Instead you should request the datatype "ES" (Economic Series):

DWE.fetch(["BHWDA347A","BHWDM8P5A"], fields=['ES'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.