27#ifndef quantlib_payoffs_hpp
28#define quantlib_payoffs_hpp
40 std::string
name()
const override;
80 std::string
name()
const override {
return "FloatingType"; }
112 std::string
name()
const override {
return "Vanilla"; }
126 std::string
name()
const override {
return "PercentageStrike"; }
145 std::string
name()
const override {
return "AssetOrNothing"; }
160 std::string
name()
const override {
return "CashOrNothing"; }
186 std::string
name()
const override {
return "Gap"; }
214 "strike (" <<
strike <<
") must be "
218 "higher than first strike (" <<
strike <<
")");
222 std::string
name()
const override {
return "SuperFund"; }
242 "higher than first strike (" <<
strike <<
")");}
246 std::string
name()
const override {
return "SuperShare"; }
degenerate base class for the Acyclic Visitor pattern
Binary asset-or-nothing payoff.
Real operator()(Real price) const override
void accept(AcyclicVisitor &) override
AssetOrNothingPayoff(Option::Type type, Real strike)
std::string name() const override
Binary cash-or-nothing payoff.
Real operator()(Real price) const override
std::string description() const override
void accept(AcyclicVisitor &) override
std::string name() const override
CashOrNothingPayoff(Option::Type type, Real strike, Real cashPayoff)
Payoff based on a floating strike
void accept(AcyclicVisitor &) override
std::string name() const override
FloatingTypePayoff(Option::Type type)
Real operator()(Real price, Real strike) const
Real operator()(Real price) const override
std::string description() const override
GapPayoff(Option::Type type, Real strike, Real secondStrike)
void accept(AcyclicVisitor &) override
Real secondStrike() const
std::string name() const override
Real operator()(Real price) const override
std::string description() const override
void accept(AcyclicVisitor &) override
std::string name() const override
Abstract base class for option payoffs.
Payoff with strike expressed as percentage
Real operator()(Real price) const override
void accept(AcyclicVisitor &) override
PercentageStrikePayoff(Option::Type type, Real moneyness)
std::string name() const override
Real operator()(Real price) const override
PlainVanillaPayoff(Option::Type type, Real strike)
void accept(AcyclicVisitor &) override
std::string name() const override
Intermediate class for payoffs based on a fixed strike.
std::string description() const override
StrikedTypePayoff(Option::Type type, Real strike)
Binary supershare and superfund payoffs.
Real operator()(Real price) const override
void accept(AcyclicVisitor &) override
Real secondStrike() const
std::string name() const override
SuperFundPayoff(Real strike, Real secondStrike)
Binary supershare payoff.
SuperSharePayoff(Real strike, Real secondStrike, Real cashPayoff)
Real operator()(Real price) const override
std::string description() const override
void accept(AcyclicVisitor &) override
Real secondStrike() const
std::string name() const override
Intermediate class for put/call payoffs.
TypePayoff(Option::Type type)
std::string description() const override
Option::Type optionType() const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified