Login  Register

Re: Calculating yield to maturity , incorrect answer ? why ?

Posted by johnacandy on Oct 19, 2010; 1:11pm
URL: http://quantlib.414.s1.nabble.com/Calculating-yield-to-maturity-incorrect-answer-why-tp8325p8333.html

I think i might have the redemption value wrong , if so plz let me know
How do we calculate the redemption value in the above scenario ??
Clean Price = 30
Face Value = 60
Coupon Rate = same = 5%= 0.05
Years to Maturity = 1


johnacandy wrote
Hi i was playing around with yesterdays code to calculate Yield To Maturity and i came up with an issue
i was using the same online calculator and this time
i used the following values
Clean Price = 30
Face Value = 60
Coupon Rate = same = 5%= 0.05
Years to Maturity = 1


Now the output of my program was 1.16667 or 1.16667*100=116.66%
and the output generated by the web application was 1.1 or 1.1*100=110%

There is a lot of of difference b/w 116% and 110 % ... what am i doing wrong??

You can view my final code at code.txt
Is my application over accurate and the entire calculators online and on excel unaccurate ?? or
is there a problem with my code ... I would appreciate any guidance i may receive in this regard thanks..




johnacandy wrote
Hi , just realized my mistake and then again i would really like to thank all of you guys in the mailing list
especially Luigi Ballabio , Harun Ozkan and offcourse Simon Ibotson. I really couldnt have managed without you guys. Thank You.

Luigi Ballabio wrote
On Oct 18, 2010, at 9:16 PM, johnacandy wrote:

>
> So i made the changes as I was told which were
> Settings::instance().evaluationDate()= bondDatedDate; //which is
> (15,June,2010)
> and made certain the Redemption was = 100.0
> and i got an output of 5.667 which unfortunately is still not  
> correct , its
> suppose to be 16.6

No, it's supposed to be 16.67% which is 0.1667.  You also want to set  
bondCoupon = 0.05.
Input and output rates are values in base 1, not percentages.

Luigi


------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users