Skip to content
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

Add more quantlib calendars #155

Closed
wilsonfreitas opened this issue Apr 17, 2021 · 11 comments
Closed

Add more quantlib calendars #155

wilsonfreitas opened this issue Apr 17, 2021 · 11 comments

Comments

@wilsonfreitas
Copy link

Hi,

Quantlib has more calendar than those available in RQuantlib.

https://github.com/lballabio/QuantLib/tree/master/ql/time/calendars

For example, the French calendar

RQuantLib::businessDaysBetween(calendar="France",
                               from=as.Date("2020-01-01"),
                               to=as.Date("2020-12-31"),
                               includeFirst = TRUE, includeLast = FALSE)

raises this error

Error in RQuantLib::businessDaysBetween(calendar = "France", from = as.Date("2020-01-01"),  : 
  Calendar France not recognised 

These calendars might be added to rquantlib.

@eddelbuettel
Copy link
Owner

eddelbuettel commented Apr 17, 2021

Yes, I would be open to careful pull requests, maybe one calendar / country at a time.

@eddelbuettel
Copy link
Owner

eddelbuettel commented Apr 17, 2021

(As an aside there is also the somewhat-dormant-and-behind Quantuccia which I wrapped in RcppQuantuccia. While smaller, it is also header-only and hence more portable.

Maybe a few of us should look into reviving it / catching it up to QuantLib ...)

@wei-wu-nyc
Copy link

I would also like to request adding "UnitedStates/FederalReserve" calendar. Thanks.

@eddelbuettel
Copy link
Owner

I was unaware that existed, ditto for "LiborImpact". Should be simple to add. Did you try?

@eddelbuettel
Copy link
Owner

It's a two-liner. I'll push that to a new branch in a minute.

> library(RQuantLib)
> hl <- holidayList("UnitedStates/FederalReserve", from=as.Date("2021-01-01"), to=as.Date("2021-12-31"))
> hl
[1] "2021-01-01" "2021-01-18" "2021-02-15" "2021-05-31" "2021-07-05" "2021-09-06" "2021-10-11" 
[8[ "2021-11-11" "2021-11-25"
> 

@wei-wu-nyc
Copy link

wei-wu-nyc commented Sep 29, 2021 via email

@eddelbuettel
Copy link
Owner

Haha, I use ccache as a prefix to my compilers via ~/.R/Makeconf (as I explained in a few places, e.g. here. It really helps with these big packages when only one out of N files changes.

@wei-wu-nyc
Copy link

wei-wu-nyc commented Sep 29, 2021 via email

@wei-wu-nyc
Copy link

wei-wu-nyc commented Sep 29, 2021 via email

@eddelbuettel
Copy link
Owner

ccache is pretty genius. When added via ~/.R/Makeconf as I do you must also add two more settings to its config (as I say in my blog post) as R uses changing paths and may mess ctimes of files. Then it is golden (if and when you re-run builds).

@eddelbuettel
Copy link
Owner

Added France too (per @wilsonfreitas earlier report).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants