Date problem in swaptionhelper.cpp

Posted by Perissin Francesco on
URL: http://quantlib.414.s1.nabble.com/Date-problem-in-swaptionhelper-cpp-tp2210.html

Hi,
I see a problem in the current implementation of the class SwaptionHelper:
when the value date is close to the end of month, the class gives an error
like: "Start date is Holiday and end of month" on some market swaptions.

This is caused by the definition of start date in line 59 in
ql/ShortRateModels/CalibrationHelpers/swaptionhelper.cpp, which does not
adjust for the holidays.

At the moment in Ql 0.3.0 and also in CVS the line is:

Date startDate = termStructure->settlementDate(). plus(maturity.length(),
maturity.units());


The line should be changed in something like

Date startDate =
termStructure->calendar().advance(termStructure->settlementDate(),
                    maturity.length(), maturity.units());



which works fine. I am not able to commit the change.

Ciao


     Francesco Perissin
          Derivatives Team
     Banca del Gottardo
          Via R. Simen 14
    6900 Lugano (Switzerland)
  Direct line: +41 91 808 37 30
           Fax: +41 91 808 24 43



--
############################### DISCLAIMER #################################

This  message  (including  any  attachments)  is  confidential  and  may be
privileged.  If you have received it by mistake please notify the sender by
return  e-mail  and  delete this message from your system. Any unauthorised
use  or  dissemination  of  this  message  in  whole or in part is strictly
prohibited.  Please  note  that e-mails are susceptible to change. Banca del
Gottardo (including  its  group  companies)  shall not be liable for the
improper  or  incomplete  transmission of the information contained in this
communication  nor  for  any delay in its receipt or damage to your system.
Banca del Gottardo  (or its group companies) does not guarantee that the
integrity   of  this  communication  has  been  maintained  nor  that  this
communication is free of viruses, interceptions or interference.

############################################################################