Re: FixedCouponBond

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/FixedCouponBond-tp3478p3479.html

On 01/03/05 21:13:54, [hidden email] wrote:
> It's a bit difficult to get started though - I didn't find any sample
> code involving bond stuff - any pointers?

Max,
        you can have a look at how bonds are used in the test-suite (see  
test-suite/bonds.*)

> I have a specific question regarding the FixedCouponBond class, maybe
> someone can help me with this:
> I have some bonds that do not pay a coupon on maturity (only the
> principal). Specifically, I have date for the first coupon paid, and a
> date for the last coupon paid (which might be different from maturity).
>
> Am I correct in assuming that I cannot replicate this with the
> FixedCouponBond class? I had a poke around in the code, and it looks as
> if I might want to make a new class were I replace the coupon rate
> argument in the definition of cash flows with a vector that is set to
> zero after my last (and before my first) interest date (and equal to the
> coupon rate at the other dates).
>
> Would that work?

Yes, that should work. I'll be happy to integrate your patch into  
FixedCouponBond if you send it to me or the list.

Later,
        Luigi