Schedule's termination date question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Schedule's termination date question

Shuo Wang-2
Hi all,

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.

------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity
while improving strategic productivity.  Learn More!
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Schedule's termination date question

Luigi Ballabio
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
Reply | Threaded
Open this post in threaded view
|

Re: Schedule's termination date question

Luigi Ballabio
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
Reply | Threaded
Open this post in threaded view
|

Re: Schedule's termination date question

Luigi Ballabio
Seeing as nobody seems to oppose it, I'm checking in the change.
"Unadjusted" now doesn't perform any adjustment.

Luigi


2012/1/20 Luigi Ballabio <[hidden email]>:

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

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
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-dev2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users