question

Upvotes
Accepted
27 6 5 4

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

1 Answer

· Write an Answer
Upvote
Accepted
86.2k 292 53 79

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

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.