27 const ext::shared_ptr<TypePayoff>&
payoff,
28 const ext::shared_ptr<Exercise>& exercise)
38 QL_REQUIRE(moreArgs !=
nullptr,
"wrong argument type");
44 OneAssetOption::arguments::validate();
48 <<
minmax <<
" not allowed");
54 const ext::shared_ptr<StrikedTypePayoff>&
payoff,
55 const ext::shared_ptr<Exercise>&
exercise)
65 QL_REQUIRE(moreArgs !=
nullptr,
"wrong argument type");
71 OneAssetOption::arguments::validate();
75 <<
minmax <<
" not allowed");
81 Date lookbackPeriodEnd,
82 const ext::shared_ptr<TypePayoff>&
payoff,
83 const ext::shared_ptr<Exercise>&
exercise)
86 lookbackPeriodEnd_(lookbackPeriodEnd) {}
94 QL_REQUIRE(moreArgs !=
nullptr,
"wrong argument type");
103 ext::shared_ptr<EuropeanExercise> europeanExercise =
104 ext::dynamic_pointer_cast<EuropeanExercise>(
exercise);
105 QL_REQUIRE(lookbackPeriodEnd <= europeanExercise->lastDate(),
106 "lookback start date must be earlier than exercise date");
108 ext::shared_ptr<FloatingTypePayoff> floatingTypePayoff =
109 ext::dynamic_pointer_cast<FloatingTypePayoff>(
payoff);
113 "lambda should be greater than or equal to 1 for calls");
115 if (floatingTypePayoff->optionType() ==
Option::Put) {
117 "lambda should be smaller than or equal to 1 for puts");
122 Date lookbackPeriodStart,
123 const ext::shared_ptr<StrikedTypePayoff>&
payoff,
124 const ext::shared_ptr<Exercise>&
exercise)
126 lookbackPeriodStart_(lookbackPeriodStart) {}
134 QL_REQUIRE(moreArgs !=
nullptr,
"wrong argument type");
142 ext::shared_ptr<EuropeanExercise> europeanExercise =
143 ext::dynamic_pointer_cast<EuropeanExercise>(
exercise);
144 QL_REQUIRE(lookbackPeriodStart <= europeanExercise->lastDate(),
145 "lookback start date must be earlier than exercise date");
Arguments for continuous fixed lookback option calculation
void validate() const override
Continuous-fixed lookback option.
void setupArguments(PricingEngine::arguments *) const override
ContinuousFixedLookbackOption(Real currentMinmax, const ext::shared_ptr< StrikedTypePayoff > &payoff, const ext::shared_ptr< Exercise > &exercise)
Arguments for continuous floating lookback option calculation
void validate() const override
Continuous-floating lookback option.
void setupArguments(PricingEngine::arguments *) const override
ContinuousFloatingLookbackOption(Real currentMinmax, const ext::shared_ptr< TypePayoff > &payoff, const ext::shared_ptr< Exercise > &exercise)
Arguments for continuous partial fixed lookback option calculation
void validate() const override
void setupArguments(PricingEngine::arguments *) const override
Date lookbackPeriodStart_
ContinuousPartialFixedLookbackOption(Date lookbackPeriodStart, const ext::shared_ptr< StrikedTypePayoff > &payoff, const ext::shared_ptr< Exercise > &exercise)
Arguments for continuous partial floating lookback option calculation
void validate() const override
ContinuousPartialFloatingLookbackOption(Real currentMinmax, Real lambda, Date lookbackPeriodEnd, const ext::shared_ptr< TypePayoff > &payoff, const ext::shared_ptr< Exercise > &exercise)
void setupArguments(PricingEngine::arguments *) const override
virtual void setupArguments(PricingEngine::arguments *) const
template class providing a null value for a given type.
Base class for options on a single asset.
ext::shared_ptr< Payoff > payoff() const
ext::shared_ptr< Exercise > exercise() const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
ext::shared_ptr< QuantLib::Payoff > payoff
Lookback option on a single asset.