-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring addHoliday() function to RQuantLib #115
Comments
That has come up in the past, and we decided against / said we cannot do it as you cannot easily persist the data from one session to the next. Easier to do something locally:
|
This is what i do currently but because the holidays are outside RQuantLib, I am unable to use any inbuilt calendar functions. For my use case, i am quite happy to reload holidays in RQuantLib at the start of each session. I have not used QuantLib directly, but posts suggest that QuantLib will also not persist any changes via addHoliday() or removeHoliday() . Please do reconsider if it makes sense. Thanks! |
Adding interfaces to I could add them, but not export them so you would need three colons to access them as an internal function. |
It was quick enough so I added it: > library(RQuantLib)
> thisweek <- Sys.Date() + -2:2
> thisweek
[1] "2018-08-20" "2018-08-21" "2018-08-22" "2018-08-23" "2018-08-24"
> isHoliday("TARGET", thisweek)
[1] FALSE FALSE FALSE FALSE FALSE
> addHolidays("TARGET", Sys.Date() + -1:1)
> isHoliday("TARGET", thisweek)
[1] FALSE TRUE TRUE TRUE FALSE
> removeHolidays("TARGET", Sys.Date() + -1:1)
> isHoliday("TARGET", thisweek)
[1] FALSE FALSE FALSE FALSE FALSE
> Will commit in a moment. |
add and remove dates (closes #115)
Quantlib has addHoliday()/removeHoliday() that adds/removes a "temporary" holiday to a calendar. However, i cannot find any such feature in RQuantLib. This will be very useful for users who install RQuantLib using the binary on Windows. Also, this function will provide functionality to implement adhoc holidays, without the need for time-consuming recompilation of Quantlib.
The text was updated successfully, but these errors were encountered: