question

Upvotes
Accepted
1 0 0 2

Bug in listRequest in DSWS R API

Hi there,

I am trying to get the constituent list (along with the Price, Weight & the price date) as on a date using DataStream Web Services API (DSWS API). Below is my code,

mnem <- 'LASX200I'

idate <- '2019-12-01' #input in YYYY-MM-DD format

mmyy <- paste0(substr(idate,6,7),substr(idate,3,4))


cdata <- mydsws$listRequest(instrument = paste0(mnem,mmyy),

datatype = c("NAME","MNEM","P","WTIDX","TIME"),

requestDate="2019-12-01")


When I am running the above code, the R wrapper tend to use the current date (as default) instead of the requestDate provided in the function. Meaning whatever the date I parse, it gives me the current date prices, weights and the date. Can you please review this and fix the bug.

datastream-apidsws-api
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.

You need to provide requestDate as either a date object -

requestDate= as.Date("2019-12-01") 

or Datastream relative date ie

requestDate= "-1W"
Upvotes
Accepted
38.1k 71 35 53

@balakrishnan.ilango

This question is similar to this thread.

You need to add MMYY after the symbol to get the historical constituent list, such as LASX200I1219 for December 2019.


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.

@jirapongse.phuriphanvichai

I am programmatically adding mmyy "instrument = paste0(mnem,mmyy)". The issue here is, the function gives the latest stocks list, prices & weights for whatever the requestDate you chose. This seems to be the bug. I checked this in Python library, it works fine. Who can fix this in the R library?

@balakrishnan.ilango

From my findings, the P field doesn’t change but the WTIDX has changed.

I think that to get time-series data for the list, we need to use timeSeriesListRequest instead.

DatastreamDSWS2R is not our library. You need to raise an issue via GitHub at https://github.com/CharlesCara/DatastreamDSWS2R.

Upvote
16 0 0 0

You need to provide requestDate as either a date object -

requestDate= as.Date("2019-12-01") 

or Datastream relative date ie

requestDate= "-1W"
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