A question concerning Bond Yield Calculation...

Posted by Toyin Akin on
URL: http://quantlib.414.s1.nabble.com/C-wrapper-tp4263p4267.html

Hi,

Maybe my logic is flawed here but I will present what I have and hopefully
somebody can put me right.

Within the Bond Yield solver, you take the clean price add on the accured
and then solve for the yield.

However the accured calculation itself never has use of the yield value.
It's simply

Accruedyearfraction*Coupon*Notional

But by adding the accured value to the Clean price and then solving for the
yield, the accrued part is now sensitive to the yield parameter as the whole
first period (that includes the accured) will be discounted.

Hence the solved Yield will not recover the clean price (nor the dirty price
for that matter as the logic to compute the dirty price within the solver
and the logic used to compute the dirty price within the Bond class is
different...).

Toy out.