Skip to content

Commit

Permalink
Allow use of forward price for swaptions implied volatility
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Jul 17, 2024
1 parent a1fbc80 commit e2de592
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion SWIG/swaption.i
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ struct Settlement {
%shared_ptr(Swaption)
class Swaption : public Option {
public:
enum PriceType { Spot, Forward };

Swaption(const ext::shared_ptr<FixedVsFloatingSwap>& swap,
const ext::shared_ptr<Exercise>& exercise,
Settlement::Type type = Settlement::Physical,
Expand All @@ -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<Real>("vega");
Expand All @@ -80,6 +83,10 @@ class Swaption : public Option {
Real annuity() {
return self->result<Real>("annuity");
}

Real forwardPrice() {
return self->result<Real>("forwardPrice");
}
}
};

Expand Down

0 comments on commit e2de592

Please sign in to comment.