Posted by
John Maiden on
URL: http://quantlib.414.s1.nabble.com/Coupons-and-Fixed-Rate-Legs-tp1151p1156.html
To summarize the initial problem, I started with a convertible bond where
the coupon schedule was set as the same schedule as the bond (schedule
determines calls/puts, dividends). I isolated the Leg because I wanted to play
with the coupon schedule.
If I decided to evaluate the bond on a daily schedule, then the coupon
schedule was screwy. If you compile the original code, then what I took to be
the pattern of payments (basically a coupon payment of zero between two dates)
seemed random. I realize now that part of it was due to the 30/360 bond day
counter. The day counter divides each coupon payment into 30 day max periods,
and does not pay a coupon on the 31st day (naturally). So I was confusing
possible coupon payments with the 30/360 day count. But the 30/360 does not
explain the pattern, otherwise I'd see a zero coupon payment roughly every 30
days. To be honest, I have no idea where that pattern came from.
My solution is to create a coupon schedule (using the FixedRateLeg) using
the actual payment schedule (typically Semiannual). In the last code snippet I
sent it, what I did was then find out the accrued coupon payment by simulating a
new daily schedule (to match a user inputted schedule) and matching the new
schedule to the dates in the FixedRateLeg (using a dynamic_pointer_cast to get
the FixedRateCoupon in the FixedRateLeg). This allowed me to create a new coupon
schedule of accrued coupon payments that matches the original schedule.
And yes, all the code you see is the code I used.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users