38 "cash settled (ParYieldCurve) swaptions not priced with Lfm engine");
40 static const Spread basisPoint = 1.0e-4;
43 swap->setPricingEngine(ext::shared_ptr<PricingEngine>(
47 std::fabs(
swap->floatingLegBPS()/
swap->fixedLegBPS());
48 Rate fixedRate =
swap->fixedRate() - correction;
49 Rate fairRate =
swap->fairRate() - correction;
51 ext::shared_ptr<SwaptionVolatilityMatrix> volatility =
52 model_->getSwaptionVolatilityMatrix();
54 Date referenceDate = volatility->referenceDate();
55 DayCounter dayCounter = volatility->dayCounter();
66 Volatility vol = volatility->volatility(exercise, swapLength,
69 blackFormula(w, fixedRate, fairRate, vol*std::sqrt(exercise));
const YieldTermStructure & discountCurve_
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.
Discounting engine for swaps.
Base class for some pricing engine on a particular model.
Handle< LiborForwardModel > model_
Shared handle to an observable.
Handle< YieldTermStructure > discountCurve_
void calculate() const override
LfmSwaptionEngine(const ext::shared_ptr< LiborForwardModel > &model, Handle< YieldTermStructure > discountCurve)
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
Real Volatility
volatility
Real Spread
spreads on interest rates
libor forward model swaption engine based on black formula
void swap(Array &v, Array &w) noexcept
Real blackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount, Real displacement)