Guys,
I am a bit confused with the dirtyPriceFromYield piece of code bellow.
It seems that even if I set Compounding to Simple the yield will be
compounded coupon by coupon.
Is it make sense?
Why donĀ“t we calculate discount factor always from settlement to couponDate?
This way Compounding setup would be followed and a fixed coupon bond would
have the same behavior of a portfolio of zero coupon ones.
What do you guys thing about?
Regards,
Piter Dias
[hidden email]
//##########################################################################
if (lastDate == Date()) {
// first not-expired coupon
if (i > 0) {
lastDate = cashflows[i-1]->date();
} else {
boost::shared_ptr coupon =
boost::dynamic_pointer_cast(cashflows[i]);
if (coupon)
lastDate = coupon->accrualStartDate();
else
lastDate = couponDate - 1*Years;
}
discount *= y.discountFactor(settlement,couponDate,
lastDate, couponDate);
} else {
discount *= y.discountFactor(lastDate, couponDate);
}
//##########################################################################
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev