Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22040/qlo
Modified Files:
.cvsignore exercise.cpp exercise.hpp
Added Files:
pricingengine.hpp swaption.cpp swaption.hpp
Log Message:
1) exported swaption
2) exported Exercise interface
Index: exercise.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/exercise.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** exercise.hpp 9 Jun 2006 18:58:47 -0000 1.2
--- exercise.hpp 19 Jun 2006 14:18:01 -0000 1.3
***************
*** 30,49 ****
public:
AmericanExercise(
! const QuantLib::Date &earliestDate,
! const QuantLib::Date &latestDate,
! const bool &payoffAtExpiry);
};
class EuropeanExercise : public Exercise {
public:
! EuropeanExercise(
! const QuantLib::Date &expiryDate);
};
class BermudanExercise : public Exercise {
public:
! BermudanExercise(
! const std::vector < QuantLib::Date > &dates,
! const bool &payoffAtExpiry);
};
--- 30,47 ----
public:
AmericanExercise(
! const QuantLib::Date& earliestDate,
! const QuantLib::Date& latestDate,
! const bool payoffAtExpiry);
};
class EuropeanExercise : public Exercise {
public:
! EuropeanExercise(const QuantLib::Date& expiryDate);
};
class BermudanExercise : public Exercise {
public:
! BermudanExercise(const std::vector<QuantLib::Date>& dates,
! const bool payoffAtExpiry);
};
***************
*** 51,53 ****
#endif
-
--- 49,50 ----
Index: .cvsignore
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/.cvsignore,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** .cvsignore 15 Jun 2006 20:23:55 -0000 1.5
--- .cvsignore 19 Jun 2006 14:18:01 -0000 1.6
***************
*** 9,29 ****
enumregistry.cpp
qladdin.hpp
! vo_bonds.*pp
! vo_calendar.*pp
! vo_capfloor.*pp
! vo_couponvectors.*pp
! vo_exercise.*pp
! vo_forwardrateagreement.*pp
! vo_interpolation.*pp
! vo_ohfunctions.*pp
! vo_options.*pp
! vo_processes.*pp
! vo_randomsequencegenerator.*pp
! vo_ratehelpers.*pp
! vo_schedule.*pp
! vo_shortratemodels.*pp
! vo_swap.*pp
! vo_termstructures.*pp
! vo_vanillaswap.*pp
! vo_volatilities.*pp
! vo_xibor.*pp
--- 9,11 ----
enumregistry.cpp
qladdin.hpp
! vo_*.*pp
--- NEW FILE: swaption.cpp ---
/*
Copyright (C) 2006 Ferdinando Ametrano
Copyright (C) 2006 Cristina Duminuco
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#if defined(HAVE_CONFIG_H)
#include <qlo/config.hpp>
#endif
#include <qlo/swaption.hpp>
#include <ql/Instruments/swaption.hpp>
namespace QuantLibAddin {
Swaption::Swaption(const boost::shared_ptr<QuantLib::VanillaSwap>& swap,
const boost::shared_ptr<QuantLib::Exercise>& exercise,
const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS
//,
//const boost::shared_ptr<QuantLib::BlackSwaptionEngine>& engine
)
{
boost::shared_ptr<QuantLib::Quote> vol_me(
new QuantLib::SimpleQuote(0.2));
QuantLib::Handle<QuantLib::Quote> vol_rh(vol_me);
boost::shared_ptr<QuantLib::BlackModel> model(
new QuantLib::BlackModel(vol_rh, hYTS));
boost::shared_ptr<QuantLib::PricingEngine> eng(
new QuantLib::BlackSwaptionEngine(model));
libraryObject_ = boost::shared_ptr<QuantLib::Instrument>(
new QuantLib::Swaption(swap, exercise, hYTS, eng));
}
}
Index: exercise.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/exercise.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** exercise.cpp 9 Jun 2006 18:58:47 -0000 1.2
--- exercise.cpp 19 Jun 2006 14:18:01 -0000 1.3
***************
*** 25,52 ****
AmericanExercise::AmericanExercise(
! const QuantLib::Date &earliestDate,
! const QuantLib::Date &latestDate,
! const bool &payoffAtExpiry) {
libraryObject_ = boost::shared_ptr<QuantLib::Exercise>(
! new QuantLib::AmericanExercise(
! earliestDate,
! latestDate,
! payoffAtExpiry));
}
! EuropeanExercise::EuropeanExercise(
! const QuantLib::Date &expiryDate) {
libraryObject_ = boost::shared_ptr<QuantLib::Exercise>(
! new QuantLib::EuropeanExercise(
! expiryDate));
}
BermudanExercise::BermudanExercise(
! const std::vector < QuantLib::Date > &dates,
! const bool &payoffAtExpiry) {
libraryObject_ = boost::shared_ptr<QuantLib::Exercise>(
! new QuantLib::BermudanExercise(
! dates,
! payoffAtExpiry));
}
--- 25,51 ----
AmericanExercise::AmericanExercise(
! const QuantLib::Date& earliestDate,
! const QuantLib::Date& latestDate,
! const bool payoffAtExpiry)
! {
libraryObject_ = boost::shared_ptr<QuantLib::Exercise>(
! new QuantLib::AmericanExercise(earliestDate,
! latestDate,
! payoffAtExpiry));
}
! EuropeanExercise::EuropeanExercise(const QuantLib::Date& expiryDate)
! {
libraryObject_ = boost::shared_ptr<QuantLib::Exercise>(
! new QuantLib::EuropeanExercise(expiryDate));
}
BermudanExercise::BermudanExercise(
! const std::vector<QuantLib::Date>& dates,
! const bool payoffAtExpiry)
! {
libraryObject_ = boost::shared_ptr<QuantLib::Exercise>(
! new QuantLib::BermudanExercise(dates,
! payoffAtExpiry));
}
--- NEW FILE: swaption.hpp ---
/*
Copyright (C) 2006 Ferdinando Ametrano
Copyright (C) 2006 Cristina Duminuco
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#ifndef qla_swaption_hpp
#define qla_swaption_cpp
#include <qlo/baseinstruments.hpp>
#include <qlo/termstructures.hpp>
#include <ql/PricingEngines/Swaption/blackswaptionengine.hpp>
namespace QuantLibAddin {
class Swaption : public Instrument {
public:
Swaption(const boost::shared_ptr<QuantLib::VanillaSwap>& swap,
const boost::shared_ptr<QuantLib::Exercise>& exercise,
const QuantLib::Handle<QuantLib::YieldTermStructure>& hYTS
//,
//const boost::shared_ptr<QuantLib::BlackSwaptionEngine>& engine
);
std::string underlyingSwap()
{
return boost::any_cast<std::string>(propertyValue("vanillaSwap"));
}
};
}
#endif
--- NEW FILE: pricingengine.hpp ---
/*
Copyright (C) 2006 Ferdinando Ametrano
Copyright (C) 2006 Cristina Duminuco
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it under the
terms of the QuantLib license. You should have received a copy of the
license along with this program; if not, please email qua...@li...
The license is also available online at http://quantlib.org/html/license.html
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#ifndef qla_pricingengine_hpp
#define qla_pricingengine_hpp
#include <oh/objhandler.hpp>
#include <ql/pricingengine.hpp>
#include <ql/PricingEngines/Swaption/blackswaptionengine.hpp>
namespace QuantLibAddin {
class BlackSwaptionEngine : public ObjHandler::LibraryObject<QuantLib::BlackSwaptionEngine> {
};
}
#endif
|