Generic date offset.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Generic date offset.

Simon Ibbotson
Hi folks,

I've been looking around in QuantLib and cannot find a generic DateOffset class.
At present - when calculating the spot date, ex-div date or even just the next date in a sequence - there are many different ways of doing this.

1) Use a Calendar, a Period and a BusinessDayConvention.
2) Use a Calendar and a fixed number of business days.
3) Use a fixed number of calendar days.
4) Use a specified Date.

I know that (2) and (3) can be replicated in (1), but there is a proliferation of interfaces already in QuantLib. For instance, the parameter "Natural settlementDays" is common, as is "Date settlementDate".

Also, what if the rules to create a date are not predictable... I'm particularly referring to calculating the spot date (particularly for FX, where the conventions are complex) or the ex-dividend date.

In addition, there are complex rules for calculating stub periods. E.g. For an annual period: "Long last stub, if it doesn't exceed 18 months else short stub".

In the current setup, the instrument needs to know the rules for calculating these dates - rather than delegating them to a specific class.

Why isn't there a generic (base?) class for this type of functionality? I'm guessing there is a reason, but it isn't obvious.

Cheers,

Simon


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev