question

Upvotes
Accepted
1 1 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 512.0 KiB each and 1.0 MiB total.

@jared.grylls

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvotes
Accepted
78.8k 249 52 74

@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 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 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 512.0 KiB each and 1.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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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