[QuantLibAddin-cvs] QuantLibAddin/qlo bonds.cpp, 1.13, 1.14 bonds.hpp, 1.13, 1.14
Brought to you by:
ericehlers,
nando
|
From: Chiara F. <chi...@us...> - 2007-01-08 14:28:51
|
Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23496/qlo Modified Files: bonds.cpp bonds.hpp Log Message: added new function: qlcmscouponbond to contruct cms coupon bond objects Index: bonds.hpp =================================================================== RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/bonds.hpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** bonds.hpp 3 Jan 2007 10:55:36 -0000 1.13 --- bonds.hpp 8 Jan 2007 14:28:45 -0000 1.14 *************** *** 1,4 **** --- 1,5 ---- /* + Copyright (C) 2006 Chiara Fornarola Copyright (C) 2006 Ferdinando Ametrano Copyright (C) 2005, 2006 Eric Ehlers *************** *** 24,28 **** --- 25,38 ---- #include <qlo/baseinstruments.hpp> #include <qlo/index.hpp> + #include <oh/objhandler.hpp> + #include <qlo/schedule.hpp> + #include <qlo/analysis.hpp> + #include <qlo/couponvectors.hpp> + #include <qlo/swaptionvolstructure.hpp> + + #include <ql/CashFlows/conundrumpricer.hpp> + #include <ql/Volatilities/all.hpp> #include <ql/Indexes/iborindex.hpp> + #include <ql/Indexes/swapindex.hpp> namespace QuantLibAddin { *************** *** 97,103 **** --- 107,142 ---- const QuantLib::Date& stub, bool fromEnd); + }; + + + class CmsCouponBond : public Bond { + public: + CmsCouponBond( + const std::string& des, + QuantLib::Real faceAmount, + const QuantLib::Date& issueDate, + const QuantLib::Date& datedDate, + const QuantLib::Date& maturityDate, + QuantLib::Integer settlementDays, + const boost::shared_ptr<QuantLib::SwapIndex>& index, + QuantLib::Integer fixingDays, + const std::vector<QuantLib::Real>& gearings, + const std::vector<QuantLib::Spread>& spreads, + QuantLib::Frequency couponFrequency, + const QuantLib::Calendar& calendar, + const QuantLib::DayCounter& dayCounter, + const boost::shared_ptr<QuantLib::VanillaCMSCouponPricer>& pricer, + const std::vector<QuantLib::Rate>& caps, + const std::vector<QuantLib::Rate>& floors, + QuantLib::BusinessDayConvention accrualConvention, + QuantLib::BusinessDayConvention paymentConvention, + QuantLib::Real redemption, + const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS, + const QuantLib::Date& stub, + bool fromEnd); }; + } Index: bonds.cpp =================================================================== RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/bonds.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** bonds.cpp 3 Jan 2007 10:55:36 -0000 1.13 --- bonds.cpp 8 Jan 2007 14:28:45 -0000 1.14 *************** *** 1,4 **** --- 1,5 ---- /* + Copyright (C) 2006 Chiara Fornarola Copyright (C) 2006 Ferdinando Ametrano Copyright (C) 2005, 2006 Eric Ehlers *************** *** 27,33 **** --- 28,36 ---- #include <qlo/termstructures.hpp> #include <qlo/typefactory.hpp> + #include <qlo/swaptionvolstructure.hpp> #include <ql/Instruments/fixedcouponbond.hpp> #include <ql/Instruments/floatingratebond.hpp> #include <ql/Instruments/zerocouponbond.hpp> + #include <ql/Instruments/cmscouponbond.hpp> namespace QuantLibAddin { *************** *** 147,149 **** --- 150,201 ---- fromEnd)); } + + + CmsCouponBond::CmsCouponBond( + const std::string& des, + QuantLib::Real faceAmount, + const QuantLib::Date& issueDate, + const QuantLib::Date& datedDate, + const QuantLib::Date& maturityDate, + QuantLib::Integer settlementDays, + const boost::shared_ptr<QuantLib::SwapIndex>& index, + QuantLib::Integer fixingDays, + const std::vector<QuantLib::Real>& gearings, + const std::vector<QuantLib::Spread>& spreads, + QuantLib::Frequency couponFrequency, + const QuantLib::Calendar& calendar, + const QuantLib::DayCounter& dayCounter, + const boost::shared_ptr<QuantLib::VanillaCMSCouponPricer>& pricer, + const std::vector<QuantLib::Rate>& caps, + const std::vector<QuantLib::Rate>& floors, + QuantLib::BusinessDayConvention accrualConvention, + QuantLib::BusinessDayConvention paymentConvention, + QuantLib::Real redemption, + const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS, + const QuantLib::Date& stub, + bool fromEnd) + : Bond(des) { + libraryObject_ = boost::shared_ptr<QuantLib::Instrument>( + new QuantLib::CmsCouponBond(faceAmount, + issueDate, + datedDate, + maturityDate, + settlementDays, + index, + fixingDays, + gearings, + spreads, + couponFrequency, + calendar, + dayCounter, + pricer, + caps, + floors, + accrualConvention, + paymentConvention, + redemption, + hYTS, + stub, + fromEnd)); } + } \ No newline at end of file |