lballabio / QuantLib

The QuantLib C++ library
http://quantlib.org
Other
5k stars 1.73k forks source link

pricing a callable floater - valid combinations of swap/swaption classes, ir models, and swaption pricing engines #1979

Open eduzea opened 1 month ago

eduzea commented 1 month ago

Hi,

I'm looking to price a bermudan callable floating rate bond using quantlib. I'm trying to adapt the approach explained in the "Gaussian1D Model" notebook in the ql examples, that is, modeling "a swaption to enter into a one leg swap with notional reimbursement at maturity". I would like to use HullWhite as the model, and an engine such as Bachelier or TreeSwaption engine.

The problem I'm facing is that it seems to use HullWhite I need to use the Swaption class, which in turn needs an underlying VanillaSwap. But I have not found a way to make a VanillaSwap that includes the nomial cashflow at the end. I have been able to create a NonStandard Swap/Swaption with this feature, but then it seems the only engine I can use is the "Gaussian1dNonstandardSwaptionEngine", which in turn requires me to use GSR as the model.

  1. Is it possible to create a VanillaSwap object that includes the nominal payment at maturity? Then I could use this swap with the regular Swaption class and use HullWhite model with the Bachelier or TreeSwaption engine...?

  2. Alternatively, if this can only be done with a NonStandard swap/swaption, is Gaussian1dNonstandardSwaptionEngine the only engine that will be compatible?

Thanks in advance,

Eduardo