Skip to content

Commit 5d1ec05

Browse files
committed
Merge remote-tracking branch 'gbfredrik/delta-interpolation' into gh_185_186_188
2 parents cb526ec + 3ad25d6 commit 5d1ec05

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

OREData/ored/marketdata/fxvolcurve.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
Copyright (C) 2016 Quaternion Risk Management Ltd
3+
Copyright (C) 2023 Skandinaviska Enskilda Banken AB (publ)
34
All rights reserved.
45
56
This file is part of ORE, a free-software/open-source library
@@ -207,6 +208,15 @@ void FXVolCurve::buildSmileDeltaCurve(Date asof, FXVolatilityCurveSpec spec, con
207208
}
208209
}
209210

211+
QuantExt::InterpolatedSmileSection::InterpolationMethod interp;
212+
if (config->smileInterpolation() == FXVolatilityCurveConfig::SmileInterpolation::Linear)
213+
interp = QuantExt::InterpolatedSmileSection::InterpolationMethod::Linear;
214+
else if (config->smileInterpolation() == FXVolatilityCurveConfig::SmileInterpolation::Cubic)
215+
interp = QuantExt::InterpolatedSmileSection::InterpolationMethod::CubicSpline;
216+
else {
217+
QL_FAIL("Delta FX vol surface: invalid interpolation, expected Linear, Cubic");
218+
}
219+
210220
// daycounter used for interpolation in time.
211221
// TODO: push into conventions or config
212222
DayCounter dc = config->dayCounter();
@@ -217,7 +227,7 @@ void FXVolCurve::buildSmileDeltaCurve(Date asof, FXVolatilityCurveSpec spec, con
217227
[](const std::pair<Real, string>& x) { return x.first; });
218228
vol_ = boost::make_shared<QuantExt::BlackVolatilitySurfaceDelta>(
219229
asof, dates, putDeltasNum, callDeltasNum, hasATM, blackVolMatrix, dc, cal, fxSpot_, domYts_, forYts_,
220-
deltaType_, atmType_, boost::none, switchTenor_, longTermDeltaType_, longTermAtmType_);
230+
deltaType_, atmType_, boost::none, switchTenor_, longTermDeltaType_, longTermAtmType_, boost::none, interp);
221231

222232
vol_->enableExtrapolation();
223233
}

0 commit comments

Comments
 (0)