25#ifndef quantlib_stickyratchet_hpp
26#define quantlib_stickyratchet_hpp
41 Real initialValue1,
Real initialValue2,
50 std::string
name()
const override;
67 Real initialValue,
Real accrualFactor)
69 gearing1, 0.0, gearing2,
70 spread1, 0.0, spread2,
75 std::string
name()
const override {
return "Ratchet"; }
84 Real initialValue,
Real accrualFactor)
86 gearing1, 0.0, gearing2,
87 spread1, 0.0, spread2,
92 std::string
name()
const override {
return "Sticky"; }
101 Real initialValue1,
Real initialValue2,
104 gearing1, gearing2, gearing3,
105 spread1, spread2, spread3,
106 initialValue1, initialValue2,
110 std::string
name()
const override {
return "RatchetMax"; }
119 Real initialValue1,
Real initialValue2,
122 gearing1, gearing2, gearing3,
123 spread1, spread2, spread3,
124 initialValue1, initialValue2,
128 std::string
name()
const override {
return "RatchetMin"; }
137 Real initialValue1,
Real initialValue2,
140 gearing1, gearing2, gearing3,
141 spread1, spread2, spread3,
142 initialValue1, initialValue2,
146 std::string
name()
const override {
return "StickyMax"; }
155 Real initialValue1,
Real initialValue2,
158 gearing1, gearing2, gearing3,
159 spread1, spread2, spread3,
160 initialValue1, initialValue2,
164 std::string
name()
const override {
return "StickyMin"; }
173 // initialValue can be a (forward) rate or a coupon/accrualFactor
174 class StickyRatchetPayoff : public Payoff {
176 StickyRatchetPayoff(Real type,
177 Real gearing1, Real gearing2,
178 Real spread1, Real spread2,
179 Real initialValue, Real accrualFactor)
180 : type_(type), gearing1_(gearing1), gearing2_(gearing2),
181 spread1_(spread1), spread2_(spread2), initialValue_(initialValue),
182 accrualFactor_(accrualFactor) {}
185 Real operator()(Real forward) const;
186 std::string description() const;
187 virtual void accept(AcyclicVisitor&);
191 Real gearing1_, gearing2_;
192 Real spread1_, spread2_;
193 Real initialValue_, accrualFactor_;
197 class RatchetPayoff_2 : public StickyRatchetPayoff {
199 RatchetPayoff_2(Real gearing1, Real gearing2,
200 Real spread1, Real spread2,
201 Real initialValue, Real accrualFactor)
202 : StickyRatchetPayoff(-1,
205 initialValue, accrualFactor) {}
208 std::string name() const { return "Ratchet";}
213 class StickyPayoff_2 : public StickyRatchetPayoff {
215 StickyPayoff_2(Real gearing1, Real gearing2,
216 Real spread1, Real spread2,
217 Real initialValue, Real accrualFactor)
218 : StickyRatchetPayoff(+1,
221 initialValue, accrualFactor) {}
224 std::string name() const { return "Sticky";}
227-----------------------------------------------------------------------------*/
degenerate base class for the Acyclic Visitor pattern
Intermediate class for single/double sticky/ratchet payoffs.
DoubleStickyRatchetPayoff(Real type1, Real type2, Real gearing1, Real gearing2, Real gearing3, Real spread1, Real spread2, Real spread3, Real initialValue1, Real initialValue2, Real accrualFactor)
std::string description() const override
void accept(AcyclicVisitor &) override
std::string name() const override
Real operator()(Real forward) const override
Abstract base class for option payoffs.
RatchetMax payoff (double option)
std::string name() const override
RatchetMaxPayoff(Real gearing1, Real gearing2, Real gearing3, Real spread1, Real spread2, Real spread3, Real initialValue1, Real initialValue2, Real accrualFactor)
RatchetMin payoff (double option)
RatchetMinPayoff(Real gearing1, Real gearing2, Real gearing3, Real spread1, Real spread2, Real spread3, Real initialValue1, Real initialValue2, Real accrualFactor)
std::string name() const override
Ratchet payoff (single option)
RatchetPayoff(Real gearing1, Real gearing2, Real spread1, Real spread2, Real initialValue, Real accrualFactor)
std::string name() const override
StickyMax payoff (double option)
StickyMaxPayoff(Real gearing1, Real gearing2, Real gearing3, Real spread1, Real spread2, Real spread3, Real initialValue1, Real initialValue2, Real accrualFactor)
std::string name() const override
StickyMin payoff (double option)
std::string name() const override
StickyMinPayoff(Real gearing1, Real gearing2, Real gearing3, Real spread1, Real spread2, Real spread3, Real initialValue1, Real initialValue2, Real accrualFactor)
Sticky payoff (single option)
std::string name() const override
StickyPayoff(Real gearing1, Real gearing2, Real spread1, Real spread2, Real initialValue, Real accrualFactor)