24 const Handle<Quote>& spot,
const Handle<YieldTermStructure>& yield1,
25 const Handle<YieldTermStructure>& yield2)
26 : BlackVolatilityTermStructure(0, surface->calendar(), surface->businessDayConvention(), surface->dayCounter()),
27 surface_(surface), spot_(spot), yield1_(yield1), yield2_(yield2) {
29 QL_REQUIRE(!
spot.empty(),
"No spot handle provided");
31 if (
surface->allowsExtrapolation())
32 this->enableExtrapolation();
41 if (strike == Null<Real>() || strike == 0) {
43 strike =
spot_->value();
47 return surface_->blackVol(t, strike);
Wrapper class for a BlackVolTermStructure that easily exposes ATM vols.
Handle< YieldTermStructure > yield2() const
QuantLib::ext::shared_ptr< BlackVolTermStructure > surface_
QuantLib::ext::shared_ptr< BlackVolTermStructure > surface() const
Handle< YieldTermStructure > yield1() const
Handle< YieldTermStructure > yield1_
Handle< Quote > spot() const
Volatility blackVolImpl(Time t, Real strike) const override
Handle< YieldTermStructure > yield2_
BlackVolatilityWithATM(const QuantLib::ext::shared_ptr< BlackVolTermStructure > &surface, const Handle< Quote > &spot, const Handle< YieldTermStructure > &yield1=Handle< YieldTermStructure >(), const Handle< YieldTermStructure > &yield2=Handle< YieldTermStructure >())
Constructor. This is a floating term structure (settlement days is zero)