26 const QuantLib::ext::shared_ptr<BlackVolTermStructure>& proxySurface,
const QuantLib::ext::shared_ptr<EqFxIndexBase>& index,
27 const QuantLib::ext::shared_ptr<EqFxIndexBase>& proxyIndex,
const QuantLib::ext::shared_ptr<BlackVolTermStructure>& fxSurface,
28 const QuantLib::ext::shared_ptr<FxIndex>& fxIndex,
const QuantLib::ext::shared_ptr<CorrelationTermStructure>& correlation)
29 : BlackVolatilityTermStructure(0, proxySurface->calendar(), proxySurface->businessDayConvention(),
30 proxySurface->dayCounter()),
31 proxySurface_(proxySurface), index_(index), proxyIndex_(proxyIndex), fxSurface_(fxSurface),
32 fxIndex_(fxIndex), correlation_(correlation) {
35 this->enableExtrapolation();
44 t = std::max(t, 1E-6);
49 Real fxForward =
fxIndex_->forecastFixing(t);
50 Volatility fxVol =
fxSurface_->blackVol(t, fxForward);
56 Volatility atmVol =
sqrt(proxyAtmVol * proxyAtmVol + fxVol * fxVol + 2 *
correlation_->correlation(t) * proxyAtmVol * fxVol);
59 Real forward =
index_->forecastFixing(t);
60 Real moneyness = std::log(strike / forward) / (atmVol *
sqrt(t));
64 Real proxyStrike = proxyForward *
exp(moneyness * proxyAtmVol *
sqrt(t));
67 Volatility proxyVol =
proxySurface_->blackVol(t, proxyStrike);
68 vol =
sqrt(proxyVol * proxyVol + fxVol * fxVol + 2 *
correlation_->correlation(t) * proxyVol * fxVol);
71 Real adjustedStrike = strike *
proxyIndex_->forecastFixing(t) /
index_->forecastFixing(t);
Wrapper class for a BlackVolTermStructure when using proxy vols.
BlackVolatilitySurfaceProxy(const QuantLib::ext::shared_ptr< BlackVolTermStructure > &proxySurface, const QuantLib::ext::shared_ptr< EqFxIndexBase > &index, const QuantLib::ext::shared_ptr< EqFxIndexBase > &proxyIndex, const QuantLib::ext::shared_ptr< BlackVolTermStructure > &fxSurface=nullptr, const QuantLib::ext::shared_ptr< FxIndex > &fxIndex=nullptr, const QuantLib::ext::shared_ptr< CorrelationTermStructure > &correlation=nullptr)
Constructor. This is a floating term structure (settlement days is zero)
QuantLib::ext::shared_ptr< EqFxIndexBase > index_
QuantLib::ext::shared_ptr< FxIndex > fxIndex_
Rate maxStrike() const override
Rate minStrike() const override
QuantLib::ext::shared_ptr< BlackVolTermStructure > proxySurface_
QuantLib::ext::shared_ptr< EqFxIndexBase > proxyIndex_
QuantLib::ext::shared_ptr< CorrelationTermStructure > correlation_
QuantLib::ext::shared_ptr< BlackVolTermStructure > fxSurface_
QuantLib::ext::shared_ptr< EqFxIndexBase > proxyIndex() const
Volatility blackVolImpl(Time t, Real strike) const override
QuantLib::ext::shared_ptr< EqFxIndexBase > index() const
QuantLib::ext::shared_ptr< BlackVolTermStructure > proxySurface() const
RandomVariable sqrt(RandomVariable x)
CompiledFormula exp(CompiledFormula x)