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

can't download several tickers with fetch #14

Closed
gvb1234 opened this issue Nov 2, 2017 · 4 comments
Closed

can't download several tickers with fetch #14

gvb1234 opened this issue Nov 2, 2017 · 4 comments

Comments

@gvb1234
Copy link

gvb1234 commented Nov 2, 2017

I can't seem to be able to fetch several tickers at once with fetch. For instance

DWE.fetch(['EUDOLLR','USDOLLR'],date_from='2000',freq='D')

does not work. However, I can do it one by one as

DWE.fetch('EUDOLLR',date_from='2000',freq='D')
DWE.fetch('USDOLLR',date_from='2000',freq='D')

and both give the correct 'P' field. I tried

DWE.fetch(['EUDOLLR(P)','USDOLLR(P)'],date_from='2000',freq='D')
DWE.fetch(['EUDOLLR','USDOLLR'],fields=['P'],date_from='2000',freq='D')

but these do not work either.

Am I missing something?

@vfilimonov
Copy link
Owner

There's a slight ambiguity of what "P" stands for.
For cash equities there's a datatype "P" which correspond to adjusted price.
However when one does the request to an API, "P" also stands for the default field. And if no fields (datatypes) are supplied, API will assume that you request "P".

However it looks like further (I don't have a documentation to verify that), that when one requests several symbols, API will treat the "P" (even if it is implied, i.e. not supplied to the request string explicitly) as a datatype and will try to retrieve such datatype. In case of exchange rates (EUDOLLR, USDOLLR) there're no such datatype - they have only bid/ask/mid rates ("EB", "EO", "ER"). So the error means exactly what it tells: INVALID CODE OR EXPRESSION ENTERED, USDOLLR(P).

So to retrieve the rates you need to supply proper datatype. For example for the mid-rate

DWE.fetch(['EUDOLLR','USDOLLR'],fields=['ER'],date_from='2000',freq='D')

or all three of them:

DWE.fetch(['EUDOLLR','USDOLLR'],fields=['ER','EB','EO'],date_from='2000',freq='D')

@gvb1234
Copy link
Author

gvb1234 commented Nov 2, 2017 via email

@vfilimonov
Copy link
Owner

I'm not sure if it is possible via the API, however it is possible in the Datastream Navigator. If you log in with the same credentials as for the API (except for the username, which should be XXXXXX if your API log in DS:XXXXXX), and search for a specific symbol - then under the chart you will see a short list of available datatypes.
I would guess that the first might be taken as default, though I'm not sure.

If you click on ">>" you'll see the longer list of datatypes for a specific ticker, which is though not always complete. In particular it does not contain static fields, and not all timeseries are listed as well.

Further - on top line of the menu of the Datastream Navigator you could click on "Datatype search" and then select a proper asset class. Here you can see the complete list of datatypes.

@vfilimonov
Copy link
Owner

Some description is added to README. So I'm closing it for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants