I am working in Python using the QuantLib library to create a swaption where the underlying swap is an OIS.
calc_date = ql.Date(23,6,2023)
exercise_date = calendar.advance(calc_date, ql.Period('1y'))
exercise = ql.EuropeanExercise(exercise_date)
settlementType = ql.Settlement.Physical
settlementMethod = ql.Settlement.ParYieldCurve
underlying_swap = ql.MakeOIS(ql.Period('1y'), sofrIndex, 0.052401, nominal=notional)
swaption = ql.Swaption(underlying_swap, 0.03943, settlementType, settlementMethod)
But this results in the following error
TypeError: Wrong number or type of arguments for overloaded function 'new_Swaption'.
Possible C/C++ prototypes are:
Swaption::Swaption(ext::shared_ptr< VanillaSwap > const &,ext::shared_ptr< Exercise > const &,Settlement::Type,Settlement::Method)
Swaption::Swaption(ext::shared_ptr< VanillaSwap > const &,ext::shared_ptr< Exercise > const &,Settlement::Type)
Swaption::Swaption(ext::shared_ptr< VanillaSwap > const &,ext::shared_ptr< Exercise > const &)
Is it not possible to create a swaption with an OIS in QuantLib? t seems to work ok with an ordinary vanilla swap. Many thanks for any help.
Support for OIS swaptions is underway but not yet there. You can watch https://github.com/lballabio/QuantLib/pull/1593 for news.