From e2de59294011248018f1ad957b8b91f9dd37093b Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Wed, 17 Jul 2024 15:07:04 +0200 Subject: [PATCH] Allow use of forward price for swaptions implied volatility --- SWIG/swaption.i | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SWIG/swaption.i b/SWIG/swaption.i index 9e5ffac99..f1784d836 100644 --- a/SWIG/swaption.i +++ b/SWIG/swaption.i @@ -46,6 +46,8 @@ struct Settlement { %shared_ptr(Swaption) class Swaption : public Option { public: + enum PriceType { Spot, Forward }; + Swaption(const ext::shared_ptr& swap, const ext::shared_ptr& exercise, Settlement::Type type = Settlement::Physical, @@ -67,7 +69,8 @@ class Swaption : public Option { Volatility minVol = 1.0e-7, Volatility maxVol = 4.0, VolatilityType type = ShiftedLognormal, - Real displacement = 0.0) const; + Real displacement = 0.0, + PriceType priceType = Spot) const; %extend { Real vega() { return self->result("vega"); @@ -80,6 +83,10 @@ class Swaption : public Option { Real annuity() { return self->result("annuity"); } + + Real forwardPrice() { + return self->result("forwardPrice"); + } } };