From 5ec38879bfb71cff5015dd6b3ab6d036c35114b4 Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Wed, 3 Apr 2024 14:50:06 +0200 Subject: [PATCH] Allow swaptions to use OIS as underlying --- SWIG/calibrationhelpers.i | 22 +++++++++++++--------- SWIG/fdm.i | 4 ++-- SWIG/swaption.i | 3 ++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/SWIG/calibrationhelpers.i b/SWIG/calibrationhelpers.i index 1c8db0af28..caab0966aa 100644 --- a/SWIG/calibrationhelpers.i +++ b/SWIG/calibrationhelpers.i @@ -83,12 +83,13 @@ class SwaptionHelper : public BlackCalibrationHelper { const DayCounter& fixedLegDayCounter, const DayCounter& floatingLegDayCounter, const Handle& termStructure, - BlackCalibrationHelper::CalibrationErrorType errorType - = BlackCalibrationHelper::RelativePriceError, + CalibrationErrorType errorType = RelativePriceError, const Real strike = Null(), const Real nominal = 1.0, const VolatilityType type = ShiftedLognormal, - const Real shift = 0.0); + const Real shift = 0.0, + Natural settlementDays = Null(), + RateAveraging::Type averagingMethod = RateAveraging::Compound); SwaptionHelper(const Date& exerciseDate, const Period& length, const Handle& volatility, @@ -97,12 +98,13 @@ class SwaptionHelper : public BlackCalibrationHelper { const DayCounter& fixedLegDayCounter, const DayCounter& floatingLegDayCounter, const Handle& termStructure, - BlackCalibrationHelper::CalibrationErrorType errorType - = BlackCalibrationHelper::RelativePriceError, + CalibrationErrorType errorType = RelativePriceError, const Real strike = Null(), const Real nominal = 1.0, const VolatilityType type = ShiftedLognormal, - const Real shift = 0.0); + const Real shift = 0.0, + Natural settlementDays = Null(), + RateAveraging::Type averagingMethod = RateAveraging::Compound); SwaptionHelper(const Date& exerciseDate, const Date& endDate, const Handle& volatility, @@ -111,13 +113,15 @@ class SwaptionHelper : public BlackCalibrationHelper { const DayCounter& fixedLegDayCounter, const DayCounter& floatingLegDayCounter, const Handle& termStructure, - BlackCalibrationHelper::CalibrationErrorType errorType - = BlackCalibrationHelper::RelativePriceError, + CalibrationErrorType errorType = RelativePriceError, const Real strike = Null(), const Real nominal = 1.0, const VolatilityType type = ShiftedLognormal, - const Real shift = 0.0); + const Real shift = 0.0, + Natural settlementDays = Null(), + RateAveraging::Type averagingMethod = RateAveraging::Compound); + ext::shared_ptr underlying() const; ext::shared_ptr underlyingSwap() const; ext::shared_ptr swaption() const; diff --git a/SWIG/fdm.i b/SWIG/fdm.i index d2c71a60f2..6fd299f116 100644 --- a/SWIG/fdm.i +++ b/SWIG/fdm.i @@ -1406,7 +1406,7 @@ class FdmAffineModelSwapInnerValue : public FdmInnerValueCalculator { FdmAffineModelSwapInnerValue( const ext::shared_ptr& disModel, const ext::shared_ptr& fwdModel, - const ext::shared_ptr& swap, + const ext::shared_ptr& swap, const std::vector