Simple Bond Calculations

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Simple Bond Calculations

Mike.Benson
I realize that this library is way overkill for this, but I am trying to get my head around how I can use this library.  Currently I have a simple library that calculates coupons and yield for basic bond types.

I have the following information:
Type: Corporate Bond
Issue: 03/01/1993
First Coupon: 07/01/1993
Last Coupon: 01/01/2020
Maturity: 03/01/2020
Day Count: 30/360

In my current library I would call a method like this to calculate yield of the bond over its life
Yield(BondType.CorporateBond, DayCount.Thirty360, issue, first, last, mature, rate)

or
Yield(BondType.CorporateBond, DayCount.Thirty360, issue, first, last, mature, rate, settleDate, settlePrice)
to get yield on cost

or
Coupons(BondType.CorporateBond, DayCount.Thirty360, issue, first, last, mature, rate, paymentFrequency, onMonthEnd)
to get all coupons paid by the bond


What I would like to do is keep my current api (in c#) and wrap up the bond library (using SWIG) to replace the simple calculator we have.  

I have the library compiled and swigged so I can get at it through c#.  

Questions:
1. I cannot find a way to have the library build a series of coupons.  
2. I also dont see a way to do a simple yield calculation.  It appears that I have to build the series of coupons, create a pricing engine and then I can calculate yield is this correct?

I have looked at the c++ source and examples to try and find an answer but I dont see any simple bond type tests.

Did I miss something or am I using this engine for something that its not really designed for?  

Any help appreciated.