Skip to content

Commit

Permalink
Allow swaptions to use OIS as underlying
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Apr 3, 2024
1 parent 9a14596 commit 5ec3887
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
22 changes: 13 additions & 9 deletions SWIG/calibrationhelpers.i
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ class SwaptionHelper : public BlackCalibrationHelper {
const DayCounter& fixedLegDayCounter,
const DayCounter& floatingLegDayCounter,
const Handle<YieldTermStructure>& termStructure,
BlackCalibrationHelper::CalibrationErrorType errorType
= BlackCalibrationHelper::RelativePriceError,
CalibrationErrorType errorType = RelativePriceError,
const Real strike = Null<Real>(),
const Real nominal = 1.0,
const VolatilityType type = ShiftedLognormal,
const Real shift = 0.0);
const Real shift = 0.0,
Natural settlementDays = Null<Size>(),
RateAveraging::Type averagingMethod = RateAveraging::Compound);

SwaptionHelper(const Date& exerciseDate, const Period& length,
const Handle<Quote>& volatility,
Expand All @@ -97,12 +98,13 @@ class SwaptionHelper : public BlackCalibrationHelper {
const DayCounter& fixedLegDayCounter,
const DayCounter& floatingLegDayCounter,
const Handle<YieldTermStructure>& termStructure,
BlackCalibrationHelper::CalibrationErrorType errorType
= BlackCalibrationHelper::RelativePriceError,
CalibrationErrorType errorType = RelativePriceError,
const Real strike = Null<Real>(),
const Real nominal = 1.0,
const VolatilityType type = ShiftedLognormal,
const Real shift = 0.0);
const Real shift = 0.0,
Natural settlementDays = Null<Size>(),
RateAveraging::Type averagingMethod = RateAveraging::Compound);

SwaptionHelper(const Date& exerciseDate, const Date& endDate,
const Handle<Quote>& volatility,
Expand All @@ -111,13 +113,15 @@ class SwaptionHelper : public BlackCalibrationHelper {
const DayCounter& fixedLegDayCounter,
const DayCounter& floatingLegDayCounter,
const Handle<YieldTermStructure>& termStructure,
BlackCalibrationHelper::CalibrationErrorType errorType
= BlackCalibrationHelper::RelativePriceError,
CalibrationErrorType errorType = RelativePriceError,
const Real strike = Null<Real>(),
const Real nominal = 1.0,
const VolatilityType type = ShiftedLognormal,
const Real shift = 0.0);
const Real shift = 0.0,
Natural settlementDays = Null<Size>(),
RateAveraging::Type averagingMethod = RateAveraging::Compound);

ext::shared_ptr<FixedVsFloatingSwap> underlying() const;
ext::shared_ptr<VanillaSwap> underlyingSwap() const;
ext::shared_ptr<Swaption> swaption() const;

Expand Down
4 changes: 2 additions & 2 deletions SWIG/fdm.i
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ class FdmAffineModelSwapInnerValue : public FdmInnerValueCalculator {
FdmAffineModelSwapInnerValue(
const ext::shared_ptr<ModelType>& disModel,
const ext::shared_ptr<ModelType>& fwdModel,
const ext::shared_ptr<VanillaSwap>& swap,
const ext::shared_ptr<FixedVsFloatingSwap>& swap,
const std::vector<Time>& exerciseTimes,
const std::vector<Date>& exerciseDates,
const ext::shared_ptr<FdmMesher>& mesher,
Expand All @@ -1427,7 +1427,7 @@ class FdmAffineModelSwapInnerValue : public FdmInnerValueCalculator {
FdmAffineModelSwapInnerValue(
const ext::shared_ptr<ModelType>& disModel,
const ext::shared_ptr<ModelType>& fwdModel,
const ext::shared_ptr<VanillaSwap>& swap,
const ext::shared_ptr<FixedVsFloatingSwap>& swap,
const std::map<Time, Date>& exerciseDates,
const ext::shared_ptr<FdmMesher>& mesher,
Size direction);
Expand Down
3 changes: 2 additions & 1 deletion SWIG/swaption.i
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ struct Settlement {
%shared_ptr(Swaption)
class Swaption : public Option {
public:
Swaption(const ext::shared_ptr<VanillaSwap>& swap,
Swaption(const ext::shared_ptr<FixedVsFloatingSwap>& swap,
const ext::shared_ptr<Exercise>& exercise,
Settlement::Type type = Settlement::Physical,
Settlement::Method settlementMethod = Settlement::PhysicalOTC);

Settlement::Type settlementType() const;
Settlement::Method settlementMethod() const;
VanillaSwap::Type type() const;
const ext::shared_ptr<FixedVsFloatingSwap>& underlying() const;
const ext::shared_ptr<VanillaSwap>& underlyingSwap() const;

//! implied volatility
Expand Down

0 comments on commit 5ec3887

Please sign in to comment.