Login  Register

Re: Schedule's termination date question

Posted by Luigi Ballabio on Dec 29, 2011; 10:56am
URL: http://quantlib.414.s1.nabble.com/Schedule-s-termination-date-question-tp6299p6300.html

Hello,
    it looks like a bug.  The endOfMonth=true flag you're passing as
the last argument to the Schedule constructor is taking precedence and
moving the termination date to the end of June (you get June 15th if
you pass false, but also March 30th instead of the two March 31st).
That's probably not the desired behavior.

I'll check the code and see what I can do (of course, if anyone wants
to have a shot at it instead, you're welcome: just drop me a line).

Thanks for the heads-up.

Luigi


On Thu, Dec 15, 2011 at 1:50 PM, Shuo Wang <[hidden email]> wrote:

> I have run the example in
> http://quantlib.org/slides/dima-ql-intro-1.pdf , the code is as below
>
>
>                Date begin(30, September, 2009), end(15, Jun, 2012);            Calendar myCal
> = Japan();              BusinessDayConvention bdC =
> BusinessDayConvention(Following);               Period myTenor(6,
> Months);                DateGeneration::Rule
> myRule=DateGeneration::Forward;         Schedule mySched(begin, end, myTenor,
> myCal, bdC, bdC, myRule, true);         std::vector<Date>
> finalSched=mySched.dates();             BOOST_FOREACH(Date d, finalSched)
> std::cout << d << std::endl;
>
> And this gives this result
>
> September 30th, 2009
> March 31st, 2010
> September 30th, 2010
> March 31st, 2011
> September 30th, 2011
> March 30th, 2012
> June 29th, 2012  <---termination date
>
>
> But the intro presentation the termination date is June 15, 2012,
> which I think is more reasonable result.
>
> I would like to ask is this behavior by design or a bug?
>
>
> --
> 王硕
> 邮箱:[hidden email]
> Whatever your journey, keep walking.

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users