Valuing fixed rate bond: dirty price vs clean price issues

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

Valuing fixed rate bond: dirty price vs clean price issues

igitur
Hi,
 
I'm trying to reconcile quantlib's fixed bond values with our own internal models (some in-house developed Excel addins). For the quantlib part, I'm actually using QLNet and I write my code in C#.
 
From the code below, I could see that the first coupon in the cashflows leg is not the full 3.5, and this is the reason of  most of the difference I'm experiencing. Our internal models assums that all the cashflows are the full 3.5. I suspect this is a clean price vs dirty price issue, but my code gives the same answer for dirtyPrice() and cleanPrice(). The yield curve is read in from a CSV file.
 
 
How can I force the cashflows to have the full coupons for all the dates?
thanks
Francois Botha

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Valuing fixed rate bond: dirty price vs clean price issues

igitur
I solved the problem, but for reference, I had to change from Settings.evaluationDate() to issueDate in this statement:

	Schedule fixedBondSchedule = new Schedule(Settings.evaluationDate(),
			maturityDate, new Period(Frequency.Semiannual),
			new SouthAfrica(),
			BusinessDayConvention.Unadjusted, 
			BusinessDayConvention.Unadjusted, 
			DateGeneration.Rule.Backward, true);
The parameter name, effectiveDate, confused me a bit.

Francois

On 5 May 2014 12:08, Francois Botha <[hidden email]> wrote:
Hi,
 
I'm trying to reconcile quantlib's fixed bond values with our own internal models (some in-house developed Excel addins). For the quantlib part, I'm actually using QLNet and I write my code in C#.
 
From the code below, I could see that the first coupon in the cashflows leg is not the full 3.5, and this is the reason of  most of the difference I'm experiencing. Our internal models assums that all the cashflows are the full 3.5. I suspect this is a clean price vs dirty price issue, but my code gives the same answer for dirtyPrice() and cleanPrice(). The yield curve is read in from a CSV file.
 
 
How can I force the cashflows to have the full coupons for all the dates?
thanks
Francois Botha


------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users