Re: MC mortgage pricing model

Posted by Ferdinando M. Ametrano-3 on
URL: http://quantlib.414.s1.nabble.com/MC-mortgage-pricing-model-tp2865p2868.html

Hi all

>>1. Holiday schedule:  A few days ago a email message was questioning
>>if 12/31/2004 is a holiday.  Here in the US, fixed income market and
>>equity market would follow a slightly different holiday schedule.

I will add few more calendar in the next days, and they will be based on
the city+exchange.

>>   It
>>would be very helpful if it has the interface to read in an external
>>file with the format of, ie, currency + YYYYMMDD.  That would avoid
>>the recompilation of the library for the sake of updating the holiday
>>schedule.  If this is not yet done, I can put in the piece if you all
>>agree to the idea.

I wouldn't deal with such a file in QuantLib, but I am thinking about
addHoliday(const Date& ), removeHoliday(const Date& ) methods which should
update addedHolidays_ and removedHolidays_ vector data members. Then the
logic could be:

if (isBusinessDay(d)) {
   if (isNotInAddedHolidays(d)) return true;
   else return false;
} else {
   if (isNotInRemovedHolidays(d)) return false;
   else return true;
}

and if you add and remove the same date... well congratulations: you're
just on your own.

ciao -- Nando