question

Upvotes
Accepted
1 0 1 0

Hi - i want to download in R ASX200 constituents, their price and weight in a time series? many thanks

datastream-apidsws-apir
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
38.1k 71 35 53

@jared.grylls

You can use the DatastreamDSWS2R from https://github.com/CharlesCara/DatastreamDSWS2R.

I assume that ASX200 is S&P/ASX 200. The symbol for this constituent is LASX200I.

The data type for price and weight should be P and WTIDX.

P is "Price - Trade" while WTIDX is "% Weight Of Each Constituent Within The List".

The code to retrieve the price and weighting is:

listDataFrame <- mydsws$listRequest(instrument = "LASX200I",
                                    datatype = c("NAME","MNEM","P","WTIDX"), 
                                    requestDate=Sys.Date())

The result is:

You can retrieve the time series data for P with the following code.

mydsws$chunkLimit <- 20L
xtsData <- mydsws$timeSeriesListRequest(instrument = "LASX200I",
                       datatype = "P",
                       startDate = "-30D",
                       endDate = "-0D",
                       frequency = "D")
xtsData

From my finding, WTIDX is not a time series type so you can't retrieve WTIDX in time series.

However, you need to directly contact the Datastream support team via my.refinitiv.com for confirmation.

For more information, please refer to the following resources.


1579144381824.png (45.8 KiB)
1579144611489.png (49.9 KiB)
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 0 1 0

hi - many thanks for your response.


the problem i am now facing is that, using the code you mentioned, it doesn't update the constituent list throughout time (Stocks come in and out normally quarterly). i think i will have to do something like the below: however this only works for monthly, instead of LASX200I1219, how could i get change the instrument to get weekly?


mydsws$listRequest(instrument = 'LASX200I1219',

datatype = list('WTIDX','WC13010','MV','P','RV','PO'),

requestDate = "0D")


thanks again

Jared

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.

@jared.grylls

Thank you for sharing.

I am unable to find instruments for the weekly constituent list. Please contact the Datastream support team via my.refinitiv.com for the way to the weekly constituent list.

Click below to post an Idea Post Idea