Login  Register

Re: Schedule's termination date question

Posted by Luigi Ballabio on Jan 20, 2012; 3:56pm
URL: http://quantlib.414.s1.nabble.com/Schedule-s-termination-date-question-tp6299p6301.html

On second thought, we might leave the adjustment if
terminationDateConvention is not 'Unadjusted' and remove it otherwise.

Thoughts anyone?

Luigi


2011/12/29 Luigi Ballabio <[hidden email]>:

> 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.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users