Posted by
LordByron on
Oct 19, 2010; 1:36pm
URL: http://quantlib.414.s1.nabble.com/Calculating-yield-to-maturity-incorrect-answer-why-tp8325p8335.html
Hi Hayyan,
It looks to be an amandable difference in figures, and, foremost, you should
explore the source of difference.
First, you'd better set the coupon rate to zero to make things less
complicated. If the difference still persists -most probably it will- then,
check out the compunding conventions. Try all of the *simple*, *compounded*,
or *continuous* compunding options.
Another probable source of difference would be about calendar. Try different
day conventions.
----- Original Message -----
From: "johnacandy" <
[hidden email]>
To: <
[hidden email]>
Sent: Tuesday, October 19, 2010 1:17 PM
Subject: Re: [Quantlib-users] Calculating yield to maturity , incorrect
answer ? why ?
>
> 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
>
http://old.nabble.com/file/p29998757/code.txt> 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
>>>
[hidden email]
>>>
https://lists.sourceforge.net/lists/listinfo/quantlib-users>>>
>>>
>>
>>
>
> --
> View this message in context:
>
http://old.nabble.com/Calculating-yield-to-maturity-%2C-incorrect-answer---why---tp29991145p29998757.html> Sent from the quantlib-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> 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
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users