Re: Advancing a Calendar by calendar (not business) days
Posted by
Luigi Ballabio on
May 04, 2016; 8:42am
URL: http://quantlib.414.s1.nabble.com/Advancing-a-Calendar-by-calendar-not-business-days-tp17436p17438.html
In this case, you don't use a calendar at all. You can write:
Date evaluationDate(31, December, 2012);
int tenor = 182;
Period p(tenor, Days);
Date maturityDate = evaluationDate + p;
or simply:
Date maturityDate = evaluationDate + 182;
Luigi
Hi,
I try to find a way to advance a Calendar object by a number of calendar
(instead of business) days. For example, having as starting date "Dec. 31,
2012" I want to add 182 days to it.
I tried to do it with:
Calendar calendar = UnitedStates();
Date evaluationDate(31, December, 2012);
int tenor = 182;
Period p(tenor, Days);
Date maturityDate = calendar.advance(evaluationDate, p, Unadjusted);
but the result is a maturity date in September (September 19th, 2013). How
can I tell Calendar that these are calendar (and not business) days?
Notice that if I convert the 182 days to months, e.g.,
Period p(6, Months);
I get "June 30th, 2013".
However, this is not an option as all tenors are coming as days (e.g., 34
days, 35 days etc.) and converting them to months will result in truncation.
Thanks,
Chris
--
View this message in context: http://quantlib.10058.n7.nabble.com/Advancing-a-Calendar-by-calendar-not-business-days-tp17436.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users