question

Upvotes
Accepted
27 3 2 3

How to get month end data in timeseries request in R

Hello,


I am trying to get a time series request to return month end values. At the moment it returns the value on the same day of the month as when I run the script. This is what my script looks like:

AB.10Y <- dsws$timeSeriesRequest(instrument = "ABND10Y",

datatype = "",

startDate = "-2Y",

endDate = "-0D",

frequency = "M")


So if I run it on the 16th it will give me the value on the 16th of each month, but I want the value from month end of each month. How can I set it do give me these results?


Thanks,

Ed.

datastream-apidsws-apirr-studio
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.

1 Answer

Upvote
Accepted
38.1k 71 35 53

@Ed_J

You can use an absolute date instead of a relative date.

 data <- mydsws$timeSeriesRequest(instrument = "ABND10Y", datatype="", startDate="2017-01-31", endDate="-0D", frequency="M")



dsws.png (31.3 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.

Click below to post an Idea Post Idea