25#include <ql/experimental/basismodels/tenorswaptionvts.hpp>
26#include <ql/experimental/basismodels/swaptioncfs.hpp>
27#include <ql/exercise.hpp>
28#include <ql/indexes/iborindex.hpp>
29#include <ql/math/rounding.hpp>
30#include <ql/pricingengines/swap/discountingswapengine.hpp>
31#include <ql/time/dategenerationrule.hpp>
63 ext::shared_ptr<VanillaSwap> baseSwap(
new VanillaSwap(
66 ext::shared_ptr<VanillaSwap> targSwap(
new VanillaSwap(
69 ext::shared_ptr<VanillaSwap> finlSwap(
new VanillaSwap(
73 baseSwap->setPricingEngine(
75 targSwap->setPricingEngine(
77 finlSwap->setPricingEngine(
84 ext::make_shared<Swaption>(
88 ext::make_shared<Swaption>(
97 Real sumTaujDeltaT = 0.0;
106 Real sumWiDeltaT = 0.0;
110 Real den = sumTaujDeltaT * sumWi - sumWiDeltaT * sumTauj;
111 Real u = -sumTauj / den;
112 Real v = sumTaujDeltaT / den;
129 Real strikeBase = (strike - (swapRateTarg_ - (1.0 + lambda_) * swapRateBase_)) /
130 (1.0 + lambda_) / annuityScaling_;
131 Real volBase = baseSmileSection_->volatility(strikeBase,
Normal, 0.0);
132 Real volTarg = annuityScaling_ * (1.0 + lambda_) * volBase;
Actual/365 (Fixed) day count convention.
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
const std::vector< Real > & floatWeights() const
const std::vector< Real > & floatTimes() const
interest rate volatility smile section
virtual const Date & exerciseDate() const
const std::vector< Real > & fixedTimes() const
const std::vector< Real > & annuityWeights() const
Time swapLength(const Period &swapTenor) const
implements the conversion between swap tenor and swap (time) length
TenorSwaptionSmileSection(const TenorSwaptionVTS &volTS, Time optionTime, Time swapLength)
ext::shared_ptr< SmileSection > baseSmileSection_
Volatility volatilityImpl(Rate strike) const override
Handle< YieldTermStructure > discountCurve_
Handle< SwaptionVolatilityStructure > baseVTS_
ext::shared_ptr< IborIndex > targIndex_
ext::shared_ptr< IborIndex > baseIndex_
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual DayCounter dayCounter() const
the day counter used for date/time conversion
Plain-vanilla swap: fix vs ibor leg.
Real Time
continuous quantity with 1-year units
QL_BIG_INTEGER BigInteger
large integer number
Real Volatility
volatility
std::size_t Size
size of a container