|
From: Dima <dim...@go...> - 2009-09-25 12:42:14
|
Simon. Can you give a little example how this could look like for a simple class? 2009/9/25 <s.i...@gm...> > Hi folks, > > I've been looking at the QuantLib constructors and have a feeling that > something better could be done regarding periods. > > Lots of the constructors have elements that ask for "number of days" or > "day offset", then date rule and holiday calendar - sometimes for several > different days - that it becomes confusing. > > For bonds (which I've helped in developing) the rules for ex-div days are > complicated. Also, for FX the rules for determining the spot date from > today's date or the expiry date from the settlement date can be exceedingly > complicated. > > Why don't we have a DateOffset class (a base class) that can act as this > function? > > So, when we need to obtain one date from another, we simply apply the > DateOffset (which can contain a holiday calendar / many holiday calendars) > to the initial date and obtain the relevant date - without needing to know > what those rules are. > > These DateOffset objects could then be obtained from a relevant market > (such as the LiborIndex objects we already have) and applied to a given > instrument. This would be particularly useful for interest-rate and FX > markets. For equity / credit markets (where there are a huge number of > underlyings) this information would have to be derived externally to > QuantLib - but the interfaces would be much cleaner. > > In other words, we decouple the market conventions from the instruments > that are traded on those markets. > > I know that this would be a major project to apply throughout QuantLib, but > that's no reason not to create this functionality and to encourage its use > in new developments / changes. > > Thoughts please? > > Cheers, > Simon > > > Sent from my BlackBerry® wireless device > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > |