Using quantlib to price swaps with different payment and calculation resets for floating leg

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using quantlib to price swaps with different payment and calculation resets for floating leg

Anyi Zhu

(This question is already posted to StackExchange, feel free to reply there too if you prefer to earn some points and/or for easier Google archival in future: http://quant.stackexchange.com/questions/29751/using-quantlib-to-price-swaps-with-different-payment-and-calculation-resets-for)

I understand the VanillaSwap object assumes that payment and calculation resets are the same, so is there any way we could use quantlib to price a swap with different reset and calculation frequencies? (say payment is semiannual but resets is annual).

A few candidates I've considered are:

  1. NonstandardSwap: however I think this does not allow different payment and reset schedules too.

  2. Swap: it takes 2 legs but Leg itself is virtual, however there are many other ways implementing this, one way is to use the IborCoupon however that seems to require repeatedly creating every single coupon in order to constructing Leg.

Is there any other simpler way to deal with this given that everything else is similar to a VanillaSwap except using different payment and calculation dates?


------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Using quantlib to price swaps with different payment and calculation resets for floating leg

Luigi Ballabio
For future reference: the answer is at the StackExchange link in the original post.


On Sun, Aug 21, 2016 at 5:00 PM Anyi Zhu <[hidden email]> wrote:

(This question is already posted to StackExchange, feel free to reply there too if you prefer to earn some points and/or for easier Google archival in future: http://quant.stackexchange.com/questions/29751/using-quantlib-to-price-swaps-with-different-payment-and-calculation-resets-for)

I understand the VanillaSwap object assumes that payment and calculation resets are the same, so is there any way we could use quantlib to price a swap with different reset and calculation frequencies? (say payment is semiannual but resets is annual).

A few candidates I've considered are:

  1. NonstandardSwap: however I think this does not allow different payment and reset schedules too.

  2. Swap: it takes 2 legs but Leg itself is virtual, however there are many other ways implementing this, one way is to use the IborCoupon however that seems to require repeatedly creating every single coupon in order to constructing Leg.

Is there any other simpler way to deal with this given that everything else is similar to a VanillaSwap except using different payment and calculation dates?

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users