Skip to content

Commit

Permalink
Add SabrSmileSection constructor taking a fixed reference date. (#1493
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lballabio committed Oct 6, 2022
2 parents b381364 + ace59de commit 870b9ac
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ql/termstructures/volatility/sabrsmilesection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,22 @@ namespace QuantLib {
const DayCounter& dc,
const Real shift,
VolatilityType volatilityType)
: SmileSection(d, dc,Date(),volatilityType,shift),
: SmileSection(d, dc, Date(), volatilityType, shift),
forward_(forward), shift_(shift) {
initialise(sabrParams);
}
}

SabrSmileSection::SabrSmileSection(const Date& d,
Rate forward,
const std::vector<Real>& sabrParams,
const Date& referenceDate,
const DayCounter& dc,
const Real shift,
VolatilityType volatilityType)
: SmileSection(d, dc, referenceDate, volatilityType, shift),
forward_(forward), shift_(shift) {
initialise(sabrParams);
}

void SabrSmileSection::initialise(const std::vector<Real>& sabrParams) {

Expand Down
12 changes: 12 additions & 0 deletions ql/termstructures/volatility/sabrsmilesection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,21 @@ namespace QuantLib {
SabrSmileSection(const Date& d,
Rate forward,
const std::vector<Real>& sabrParameters,
const Date& referenceDate = Date(),
const DayCounter& dc = Actual365Fixed(),
Real shift = 0.0,
VolatilityType volatilityType = VolatilityType::ShiftedLognormal);
/*! \deprecated Use the constructor taking an optional reference date.
Deprecated in version 1.28.
*/
QL_DEPRECATED
SabrSmileSection(const Date& d,
Rate forward,
const std::vector<Real>& sabrParameters,
const DayCounter& dc,
Real shift = 0.0,
VolatilityType volatilityType = VolatilityType::ShiftedLognormal);

Real minStrike() const override { return -shift_; }
Real maxStrike() const override { return QL_MAX_REAL; }
Real atmLevel() const override { return forward_; }
Expand Down

0 comments on commit 870b9ac

Please sign in to comment.