# novice question on fixed coupon schedule in QuantLib

For some bonds I work with the last coupon date is not equal to bond's maturity date. E.g. the last coupon date is April 25th, 2020 and maturity date is April 25th, 2021. I looked at Schedule class and MakeSchedule() and I don't see a clear way to reflect this. I feel it can't be that hard, though. Would appreciate if someone gives me a hint. Thank you!

-
To check that I understand: do you mean that the last coupon is paid in 2020 and only the redemption is paid upon maturity in 2021? –  Luigi Ballabio Apr 29 '14 at 7:37

You can obtain the desired effect by tweaking the bond construction.

For instance, let's say you're creating a 4-years bond with semiannual coupons paying 3%, but missing the last. This makes for 7 coupons. Instead, you'll create the schedule as usual (so you have 8 periods), but specify a null last coupon when creating the bond. So:

Schedule schedule = ...;  // as for a "normal" bond;

std::vector<Rate> coupons(8, 0.03);  // 8 coupons...
coupons.back() = 0.0;   // but the last one pays 0%.

FixedRateBond bond(settlementDays, faceAmount,
schedule, coupon,
accrualDayCounter);


This will give you the correct price; the disadvantage is that you'll have a coupon paying 0%, which is less clean than having just the ones that actually exist. If this turns out to be a problem, you can inherit from FixedRateCouponBond and delete the coupon in the constructor. But I would guess it's way easier to just filter out null cash flows in your client code.

You can use the same trick for most kinds of bond; e.g., for floating-rate bonds you can cancel the last coupon by passing a null gearing.

-
Thank you! I did not quite get the idea about inheriting from FixedRateCouponBond, but the first method should work. By the way -- is there an easy way to calculate the number of coupon payments given the issue and maturity dates? For now I just use maturityDate.year() - issueDate.year() and then adjust depending on maturityDate.month() - issueDate.month() value. I wonder if there is more elegant way to calculate the # of coupon payments. –  user7922 Apr 30 '14 at 20:32
Once you have build the schedule, you can retrieve the number of coupons as schedule.size()-1. –  Luigi Ballabio Apr 30 '14 at 20:58
I wonder if there is another way to implement this? One shortcoming of this approach is that, if the settlement date falls between last coupon date and maturity date, when I call accruedDays(bond, settlementDate), it will return a non-zero accrued days (while the accrued days should be zero) –  Laura Le Mar 3 at 13:56
@LauraLe I converted your answer to a comment as it was not really an answer to the question asked. If you want to, you can elaborate a bit more and ask a new question. –  Bob Jansen Mar 3 at 14:17
As I mentioned, another way to implement this would be to inherit from FixedRateCouponBond and delete the coupon in the constructor. –  Luigi Ballabio Mar 5 at 10:35