19#include <ql/settings.hpp>
26 const QuantLib::ext::shared_ptr<EuropeanExercise>& maturity,
const std::set<Date>& valuationDates,
27 const Date& paymentDate,
const Real notional,
const Position::Type& longShort,
28 const Real localCap,
const Real localFloor,
const Real globalCap,
const Real globalFloor,
29 const Real premium,
const Date& premiumPayDate,
const std::string& premiumCurrency)
30 :
OneAssetOption(payoff, maturity), valuationDates_(valuationDates), paymentDate_(paymentDate), notional_(notional),
31 longShort_(longShort), localCap_(localCap), localFloor_(localFloor), globalCap_(globalCap),
32 globalFloor_(globalFloor), premium_(premium), premiumPayDate_(premiumPayDate), premiumCurrency_(premiumCurrency) {
34 QL_REQUIRE(
valuationDates.size() > 0,
"cliquet option: at least one valuation date must be given");
35 QL_REQUIRE(paymentDate >= *
valuationDates.rbegin(),
"cliquet option: payment date ("
36 << paymentDate <<
") must be after last valuation date ("
43 OneAssetOption::setupArguments(args);
45 QL_REQUIRE(moreArgs != 0,
"cliquet option: wrong engine type");
49 moreArgs->
moneyness = QuantLib::ext::dynamic_pointer_cast<PercentageStrikePayoff>(payoff_)->strike();
50 moreArgs->
type = QuantLib::ext::dynamic_pointer_cast<PercentageStrikePayoff>(payoff_)->optionType();
64 QuantLib::ext::shared_ptr<PercentageStrikePayoff>
moneyness = QuantLib::ext::dynamic_pointer_cast<PercentageStrikePayoff>(payoff);
65 QL_REQUIRE(
moneyness,
"wrong payoff type");
66 QL_REQUIRE(
moneyness->strike() > 0.0,
"negative or zero moneyness given");
std::set< Date > valuationDates
std::string premiumCurrency
void validate() const override
const Position::Type longShort_
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
const std::set< Date > & valuationDates() const
CliquetOption(const QuantLib::ext::shared_ptr< PercentageStrikePayoff > &payoff, const QuantLib::ext::shared_ptr< EuropeanExercise > &maturity, const std::set< Date > &valuationDates, const Date &paymentDate, const Real notional, const Position::Type &longShort, const Real localCap=Null< Real >(), const Real localFloor=Null< Real >(), const Real globalCap=Null< Real >(), const Real globalFloor=Null< Real >(), const Real premium=Null< Real >(), const Date &premiumPayDate=Date(), const std::string &premiumCurrency="")
const std::string premiumCurrency_
const std::set< Date > valuationDates_
const Date premiumPayDate_