# Tag Info

0

Cannot post a comment to your question. I assume if you are calculating YTM of a floating rate bond, that you have the dirty price of it. And also that you have the expected curve for the floating rate. Floating rate will affect your coupon payments... so just apply the floating rate to the coupons and calculate the YTM by iterating or with a financial calc. ...

2

You can't really add/subtract the n and t indices. The fact that you didn't use Latex in your question makes it even more confusing :) The $t$ refers to the time of the price and $n$ refers to the time to maturity of the bond, the bond has $n$ periods remaining and matures at ($t+n$). If today's price is $p_t^{(n)}$ then tomorrow's price is \$p_{t+1}^{(n-1)}...

4

I would start by saying that yes, this is an acceptable precision. However, the reason you are not getting the same result is because, by default, QuantLib has accuracy=1.0e-8 and maxEvaluations=100. You can set these parameters like this: bond.bondYield(bond_price, dayCount, ql.Simple, ql.Quarterly, ql.Date(), 1.0e-16, 100) This will get you much closer....

Top 50 recent answers are included