lballabio / QuantLib

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

FloatingRateCoupon fixingDate() Following #2015

Open klin333 opened 2 months ago

klin333 commented 2 months ago

Hi,

In FloatingRateCoupon fixingDate(), it hardcodes Preceding business day convention. https://github.com/lballabio/QuantLib/blob/1378d4989810cfa5f8024bd3664d14c8fff2d583/ql/cashflows/floatingratecoupon.cpp#L79-L84

What can be done if I want Following business day convention. An example is this Australian bank hybrid, where the coupon schedule is Unadjusted, ie coupon accrual start and end dates are 22nd of each quarter, Unadjusted (even though coupon payment itself is Following business day adjusted with no compensation to holder for the delay). I believe this means that the Schedule object must use Unadjusted. However, this hybrid bond also states that the index fixing "will be determined on the first Business Day of each Distribution Period", ie in the quoted lines above in fixingDate(), I need Following.

This feels like quite a large job, as it involves FloatingRateCoupon, FloatingLeg, IborCoupon, IborLeg, FloatingRateBond.

https://www.westpac.com.au/content/dam/public/wbc/documents/pdf/aw/ic/Westpac_Capital_Notes_5_Prospectus.pdf

lballabio commented 1 month ago

Hmm, you're right, it's tricky to add to the current implementation.