question

Upvotes
Accepted
3 0 0 2

Datastream Functions in DSWS

Within Datastream Web Service (DSWS), I want to use Datastream Functions (link) for time series, as they exist within the TR Datastream Excel plugin.

For example 'PCH#(X(P), 3M)'

When I do a static request for a single day, I get a result.

However, when I try a time serie, I got the error

"Error - please check instruments and parameters (time series or static)"

Are Datastream function not supported for time series in DSWS?

datastream-apidsws-apitime-series
icon clock
10 |1500

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

Upvotes
Accepted
1.1k 3 3 3

@maarten.vanhalst

Unfortunately this symbol substitution function is not available in time series request in Python. We will be working on new version of Python add-in during 2019 and we will make sure this option is included.

For now what I would suggest is creating the request with PCH# function for separate instruments, like this:

ds.get_data(tickers='PCH#(VOD(P), -3M)’, 'PCH#(U:FB(P), -3M)’, fileds=’X’, start='20180731', freq='M')

icon clock
10 |1500

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

Upvotes
1.1k 3 3 3

@maarten.vanhalst

Hi Maarten,

DSWS supports functions however it is difficult to say what is causing the error message based on above description. Please paste this time series request, which will help replicate what you are seeing and help advise.

Kind regards,

Monika

icon clock
10 |1500

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

Upvotes
3 0 0 2

@Monika.Stankovic

Thank you for your reply.

I'll make it easyier: can you provide me an example (any API or Web Service, doesn't really matter) with a function (e.g. PCH#).

I ll try to find out where I went wrong myself.

I looked around in the documentations, and I found mutliple examples but none including a Datastream function.

Best regards,

Maarten

EDIT: I add my example anyway. But would still love to have a working example from your part.

For example in python, with ds is the pyDSWS.DataStream object and ids an identifier.

The static request

ds.get_data(ids, fields=['PCH#(X(P), 3M)'], date='20180731')

returns me the value for 2018-07-31

However the time series request

df = ds.get_data(ids, fields=['PCH#(X(P), 3M)'], start='20180731', freq='M')

returns an error:

Error - please check instruments and parameters (time series or static)


icon clock
10 |1500

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

Click below to post an Idea Post Idea