FixedCouponBond

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

FixedCouponBond

m.e.bruche@lse.ac.uk
Hello,

I found QuantLib on the net and thought I would give it a try to do some
bond related stuff - it's a great project!

It's a bit difficult to get started though - I didn't find any sample
code involving bond stuff - any pointers?

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?

Thanks,

Max


Reply | Threaded
Open this post in threaded view
|

Re: FixedCouponBond

Luigi Ballabio
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