Schedule: is this expected?

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

Schedule: is this expected?

Luca Billi
Hi,

this code:

Schedule schedule(Date(30, Sep, 2010),
                            Date(28, Feb, 2011),
                            1*Months,
                            TARGET(),
                            Following,
                            Following,
                            DateGeneration::Backward,
                            true);

generates these dates:

2010-09-30
2010-10-29     <----- Here I'd have expected 2010-11-01 instead
2010-11-30
2010-12-31
2011-01-31
2011-02-28

When endOfMonth == true, Following doesn't apply but rather ModifiedFollowing.
Is this the intended behavior?

Luca

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Schedule: is this expected?

Luigi Ballabio
On Mon, 2011-02-07 at 17:16 -0500, Luca Billi wrote:

> this code:
>
> Schedule schedule(Date(30, Sep, 2010),
>                             Date(28, Feb, 2011),
>                             1*Months,
>                             TARGET(),
>                             Following,
>                             Following,
>                             DateGeneration::Backward,
>                             true);
>
> generates these dates:
>
> 2010-09-30
> 2010-10-29     <----- Here I'd have expected 2010-11-01 instead
> 2010-11-30
> 2010-12-31
> 2011-01-31
> 2011-02-28
>
> When endOfMonth == true, Following doesn't apply but rather ModifiedFollowing.
> Is this the intended behavior?

End-of-month says that the schedule should generate dates on the last
business day of the month, and as such overrides business-day
convention.

Luigi


--

Poets have been mysteriously silent on the subject of cheese.
-- Gilbert K. Chesterton



------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Schedule: is this expected?

Luigi Ballabio
On Tue, 2011-02-08 at 09:12 +0100, Luigi Ballabio wrote:
> End-of-month says that the schedule should generate dates on the last
> business day of the month, and as such overrides business-day
> convention.

In fact, the constructor is probably misleading.  There should be a
Schedule constructor taking conventions, and another one to be used for
end-of-month (which takes no convention, but maybe just a boolean to
specify whether dates should be adjusted.)  Any thoughts?

Luigi


--

feature, n:
A surprising property of a program. Occasionally documented.
To call a property a feature sometimes means the author did not
consider that case, and the program makes an unexpected, though
not necessarily wrong response. See BUG. "That's not a bug,
it's a feature!" A bug can be changed to a feature by
documenting it.



------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Schedule: is this expected?

Simon Ibbotson-2
I'd make it an enumeration rather than a Boolean. If I remember
correctly, there are two forms of end-end convention, one which triggers
if the reference date is the last day of the month and one which
triggers if the reference date is the last working day of the month.

Regardless, an enumeration is more flexible and should always be used in
preference to a Boolean.

Simon


-----Original Message-----
From: Luigi Ballabio [mailto:[hidden email]]
Sent: 08 February 2011 08:15
To: Luca Billi
Cc: [hidden email]
Subject: Re: [Quantlib-dev] Schedule: is this expected?

On Tue, 2011-02-08 at 09:12 +0100, Luigi Ballabio wrote:
> End-of-month says that the schedule should generate dates on the last
> business day of the month, and as such overrides business-day
> convention.

In fact, the constructor is probably misleading.  There should be a
Schedule constructor taking conventions, and another one to be used for
end-of-month (which takes no convention, but maybe just a boolean to
specify whether dates should be adjusted.)  Any thoughts?

Luigi


--

feature, n:
A surprising property of a program. Occasionally documented.
To call a property a feature sometimes means the author did not
consider that case, and the program makes an unexpected, though
not necessarily wrong response. See BUG. "That's not a bug,
it's a feature!" A bug can be changed to a feature by
documenting it.



------------------------------------------------------------------------
------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio
XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev



This communication and any attachments contains information which is confidential and may be subject to legal privilege. It is for intended recipients only. If you are not the intended recipient you must not copy, distribute, publish, rely on or otherwise use it without our consent. Some of our communications may contain confidential information which it could be a criminal offence for you to disclose or use without authority. If you have received this email in error please notify [hidden email] immediately and delete the email from your computer.

The FSA reserves the right to monitor all email communications for compliance with legal, regulatory and professional standards.
This email is not intended to nor should it be taken to create any legal relations or contractual relationships. This email has originated from

The Financial Services Authority (FSA)
25 The North Colonnade,
Canary Wharf,
London
E14 5HS
United Kingdom

Registered as a Limited Company in England and Wales No.1920623.
Registered Office as above

Switchboard: 020 7066 1000
Web Site: http://www.fsa.gov.uk
*****************************************************************


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev