26 const std::vector<Time>& times,
27 const std::vector<Handle<Quote>>& volSpreads,
28 const bool useAtmReferenceVolsOnly)
29 : BlackVolatilityTermStructure(referenceVol->businessDayConvention(), referenceVol->dayCounter()),
30 referenceVol_(referenceVol), times_(times), volSpreads_(volSpreads),
31 useAtmReferenceVolsOnly_(useAtmReferenceVolsOnly), data_(times.size(), 0.0) {
33 QL_REQUIRE(
times_.size() >= 2,
"at least two times required");
34 QL_REQUIRE(
times_.size() ==
volSpreads_.size(),
"size of time and quote vectors do not match");
38 QuantLib::ext::make_shared<LinearInterpolation>(
times_.begin(),
times_.end(),
data_.begin()));
56 BlackVolatilityTermStructure::update();
60 for (Size i = 0; i <
times_.size(); ++i) {
61 QL_REQUIRE(!
volSpreads_[i].empty(),
"SpreadedBlackVolatilityCurve: empty quote at index " << (i - 1));
void performCalculations() const override
Handle< BlackVolTermStructure > referenceVol_
Calendar calendar() const override
Real blackVolImpl(Time t, Real) const override
const Date & referenceDate() const override
Real minStrike() const override
std::vector< Time > times_
bool useAtmReferenceVolsOnly_
SpreadedBlackVolatilityCurve(const Handle< BlackVolTermStructure > &referenceVol, const std::vector< Time > ×, const std::vector< Handle< Quote > > &volSpreads, const bool useAtmReferenceVolsOnly=false)
Natural settlementDays() const override
Date maxDate() const override
Real maxStrike() const override
QuantLib::ext::shared_ptr< Interpolation > interpolation_
std::vector< Handle< Quote > > volSpreads_
std::vector< Real > data_
Spreaded Black volatility curve.