Re: Bonds sample
Posted by N_Lassesen on
URL: http://quantlib.414.s1.nabble.com/Bonds-sample-tp12365p12369.html
Regarding the quantlib bond classes, what is the reasoning behind the fact that one has to create a schedule (for coupons) and provide it to the bond constructor, instead of providing the necessary information to the bond constructor and then have it construct the needed schedule?
Furthermore when you need the bond yield, the way to get it is (assuming an existing fixedRateBond object with semiannual coupon payments):
Real price = 73.27;
Rate yld = fixedRateBond.yield(price,Thirty360(Thirty360::EurobondBasis),Compounded,Semiannual);
where especially the need to provide the Frequency parameter troubles me, because that frequency was allready provided when the coupon schedule was created. The need to provide this frequency here also is, in my opinion, quite confusing.
/Nicolai