-----Original Message-----
From: Luigi Ballabio <
[hidden email]>
Date: Tue, 02 Feb 2010 18:52:21
To: ravi agrawal<
[hidden email]>
Cc: <
[hidden email]>
Subject: Re: [Quantlib-users] Why does DayCounter Business252 blow up the
pricing time
On Tue, 2010-02-02 at 11:15 -0600, ravi agrawal wrote:
> I wanted to know why is Business252
> DayCounter dayCounter252 =
> Business252(UnitedStates(UnitedStates::NYSE));
> is increasing the time taken to price option.
Business252 must count the business days between the dates, which can
only be done by iterating over all the dates in between and checking
whether they are holidays (see the Calendar::businessDaysBetween method,
which is called by Business252::Impl::dayCount.) All other day counters
just count the actual days between the dates (or some approximation
thereof) which can be done very quickly by taking the difference between
the two dates.
Luigi
--
All parts should go together without forcing. You must remember that
the parts you are reassembling were disassembled by you. Therefore, if
you can't get them together again, there must be a reason. By all
means, do not use a hammer.
-- IBM maintenance manual, 1925