Skip to content

Commit b2c583b

Browse files
committed
QPR-13765 add missing volType to vol surfaces
1 parent f6d53a9 commit b2c583b

5 files changed

Lines changed: 15 additions & 8 deletions

File tree

QuantExt/qle/termstructures/blackinvertedvoltermstructure.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class BlackInvertedVolTermStructure : public BlackVolTermStructure {
4141
/*! This will work with both a floating and fixed reference date underlying surface,
4242
since we are reimplementing the reference date and update methods */
4343
BlackInvertedVolTermStructure(const Handle<BlackVolTermStructure>& vol)
44-
: BlackVolTermStructure(vol->businessDayConvention(), vol->dayCounter()), vol_(vol) {
44+
: BlackVolTermStructure(vol->businessDayConvention(), vol->dayCounter(), vol->volType(), vol->shift()),
45+
vol_(vol) {
4546
registerWith(vol_);
4647
}
4748

QuantExt/qle/termstructures/blackvariancesurfacestddevs.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ namespace QuantExt {
2828
BlackVarianceSurfaceStdDevs::BlackVarianceSurfaceStdDevs(
2929
const Calendar& cal, const Handle<Quote>& spot, const std::vector<Time>& times, const std::vector<Real>& stdDevs,
3030
const std::vector<std::vector<Handle<Quote>>>& blackVolMatrix, const DayCounter& dayCounter,
31-
const QuantLib::ext::shared_ptr<EqFxIndexBase>& index, bool stickyStrike, bool flatExtrapMoneyness)
32-
: BlackVarianceSurfaceMoneyness(cal, spot, times, stdDevs, blackVolMatrix, dayCounter, stickyStrike), index_(index),
33-
flatExtrapolateMoneyness_(flatExtrapMoneyness) {
31+
const QuantLib::ext::shared_ptr<EqFxIndexBase>& index, bool stickyStrike, bool flatExtrapMoneyness,
32+
BlackVolTimeExtrapolation timeExtrapolation, const VolatilityType type, const Real shift)
33+
: BlackVarianceSurfaceMoneyness(cal, spot, times, stdDevs, blackVolMatrix, dayCounter, stickyStrike,
34+
flatExtrapMoneyness, timeExtrapolation, type, shift),
35+
index_(index), flatExtrapolateMoneyness_(flatExtrapMoneyness) {
3436

3537
// set up atm variance curve - maybe just take ATM vols in
3638
vector<Real>::const_iterator it = find(stdDevs.begin(), stdDevs.end(), 0.0);

QuantExt/qle/termstructures/blackvariancesurfacestddevs.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ class BlackVarianceSurfaceStdDevs : public BlackVarianceSurfaceMoneyness {
4343
const std::vector<Real>& stdDevs,
4444
const std::vector<std::vector<Handle<Quote> > >& blackVolMatrix,
4545
const DayCounter& dayCounter, const QuantLib::ext::shared_ptr<EqFxIndexBase>& index,
46-
bool stickyStrike = false, bool flatExtrapMoneyness = false);
46+
bool stickyStrike = false, bool flatExtrapMoneyness = false,
47+
BlackVolTimeExtrapolation timeExtrapolation = BlackVolTimeExtrapolation::FlatVolatility,
48+
const VolatilityType type = VolatilityType::ShiftedLognormal,
49+
const Real shift = 0.0);
4750

4851
// A method that takes a reference to a vector of vector of quotes (that will be populated), termstructure,
4952
// expiry times, and standard deviation points. Fills the quotes with the correct points from the termstructure.

QuantExt/qle/termstructures/blackvolconstantspread.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ namespace QuantExt {
2424

2525
BlackVolatilityConstantSpread::BlackVolatilityConstantSpread(const Handle<BlackVolTermStructure>& atm,
2626
const Handle<BlackVolTermStructure>& surface)
27-
: BlackVolTermStructure(0, atm->calendar(), atm->businessDayConvention(), atm->dayCounter()), atm_(atm),
28-
surface_(surface) {
27+
: BlackVolTermStructure(0, atm->calendar(), atm->businessDayConvention(), atm->dayCounter(), atm->volType(),
28+
atm->shift()),
29+
atm_(atm), surface_(surface) {
2930
enableExtrapolation(atm->allowsExtrapolation());
3031
registerWith(atm);
3132
registerWith(surface);

QuantExt/qle/termstructures/blackvolsurfaceproxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ BlackVolatilitySurfaceProxy::BlackVolatilitySurfaceProxy(
2727
const QuantLib::ext::shared_ptr<EqFxIndexBase>& proxyIndex, const QuantLib::ext::shared_ptr<BlackVolTermStructure>& fxSurface,
2828
const QuantLib::ext::shared_ptr<FxIndex>& fxIndex, const QuantLib::ext::shared_ptr<CorrelationTermStructure>& correlation)
2929
: BlackVolatilityTermStructure(0, proxySurface->calendar(), proxySurface->businessDayConvention(),
30-
proxySurface->dayCounter()),
30+
proxySurface->dayCounter(), proxySurface->volType(), proxySurface->shift()),
3131
proxySurface_(proxySurface), index_(index), proxyIndex_(proxyIndex), fxSurface_(fxSurface),
3232
fxIndex_(fxIndex), correlation_(correlation) {
3333

0 commit comments

Comments
 (0)