|
From: Ferdinando A. <qf...@am...> - 2009-04-16 15:16:41
|
Hi all in revision 16174 (http://quantlib.svn.sourceforge.net/quantlib/?rev=16174&view=rev) I've revisited Instrument::isExpired implementation, which is now often using Event::hasOccurredFunction I noticed that in many cases the Instrument is considered to be expired if its last payment date is earlier than Settings::instance().evaluationDate(). Unless I miss something this approach is wrong. isExired if often used in order to bypass NPV evaluation setting it to zero, and as such it should rely on a PricingEngine and/or TermStructure::referenceDate() to verify expiration E.g. Bond::isExpired check the settlementDate() vs Settings::instance().evaluationDate(). This imply that if a bond trade with t+3 settlement it could be expired and still have cashflows to be discounted for an YieldTermStructure with t=0 as referenceDate If I'm right removing the default referenceDate from Event::hasOccurredFunction would show at compilation time most of the places where expiration is deduced from Settings::instance().evaluationDate() Any feedback? ciao -- Nando |