22#include <ql/cashflows/cashflowvectors.hpp>
23#include <ql/cashflows/couponpricer.hpp>
24#include <ql/cashflows/fixedratecoupon.hpp>
25#include <ql/termstructures/yieldtermstructure.hpp>
26#include <ql/utilities/vectors.hpp>
33 LazyObject::alwaysForwardNotifications();
43 QL_REQUIRE(
underlying_->pricer(),
"pricer not set");
45 if (
floor_ != Null<Real>() ||
cap_ != Null<Real>())
46 pricer()->initialize(*
this);
47 Rate floorletRate = 0.;
48 if (
floor_ != Null<Real>())
51 if (
cap_ != Null<Real>())
53 rate_ = swapletRate + floorletRate - capletRate;
54 auto p = QuantLib::ext::dynamic_pointer_cast<CapFlooredAverageBMACouponPricer>(pricer());
55 QL_REQUIRE(p,
"CapFlooredAverageBMACoupon::performCalculations(): internal error, could not cast to "
56 "CapFlooredAverageBMACouponPricer");
73 if (
cap_ == Null<Real>())
86 if (
floor_ == Null<Real>())
106 Visitor<CappedFlooredAverageBMACoupon>* v1 =
dynamic_cast<Visitor<CappedFlooredAverageBMACoupon>*
>(&v);
110 FloatingRateCoupon::accept(v);
114 Real cap, Real floor,
bool nakedOption,
bool includeSpread)
115 :
FloatingRateCoupon(underlying->date(), underlying->nominal(), underlying->accrualStartDate(),
116 underlying->accrualEndDate(), underlying->fixingDays(), underlying->index(),
117 underlying->gearing(), underlying->spread(), underlying->referencePeriodStart(),
118 underlying->referencePeriodEnd(), underlying->dayCounter(), false),
119 underlying_(underlying), cap_(cap), floor_(floor), nakedOption_(nakedOption), includeSpread_(includeSpread) {
121 "CappedFlooredAverageBMACoupon: if include spread = true, only a gearing 1.0 is allowed - scale "
122 "the notional in this case instead.");
131 const bool effectiveVolatilityInput)
132 : capletVol_(v), effectiveVolatilityInput_(effectiveVolatilityInput) {
Pricer for average overnight indexed coupons.
coupon paying a capped / floored average bma rate
bool effectiveVolatilityInput() const
Real effectiveCapletVolatility() const
Real effectiveCapletVolatility_
Handle< OptionletVolatilityStructure > capletVolatility() const
Handle< OptionletVolatilityStructure > capletVol_
Real effectiveFloorletVolatility() const
Real effectiveFloorletVolatility_
bool effectiveVolatilityInput_
CapFlooredAverageBMACouponPricer(const Handle< OptionletVolatilityStructure > &v, const bool effectiveVolatilityInput=false)
void performCalculations() const override
Real effectiveCapletVolatility() const
effective caplet volatility
bool includeSpread() const
Real effectiveCapletVolatility_
void deepUpdate() override
ext::shared_ptr< AverageBMACoupon > underlying_
Rate rate() const override
virtual void accept(AcyclicVisitor &) override
Real effectiveFloorletVolatility() const
effective floorlet volatility
CappedFlooredAverageBMACoupon(const ext::shared_ptr< AverageBMACoupon > &underlying, Real cap=Null< Real >(), Real floor=Null< Real >(), bool nakedOption=false, bool includeSpread=false)
Rate effectiveCap() const
effective cap of fixing
Real effectiveFloorletVolatility_
Rate effectiveFloor() const
effective floor of fixing
Rate convexityAdjustment() const override
void alwaysForwardNotifications() override
Filter close_enough(const RandomVariable &x, const RandomVariable &y)