Login  Register

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

Posted by Simon Ibbotson-2 on Oct 18, 2010; 3:36pm
URL: http://quantlib.414.s1.nabble.com/Calculating-yield-to-maturity-incorrect-answer-why-tp8325p8328.html

1 year before maturity... so in this case, 15 June 2010

-----Original Message-----
From: johnacandy [mailto:[hidden email]]
Sent: 18 October 2010 16:33
To: [hidden email]
Subject: Re: [Quantlib-users] Calculating yield to maturity , incorrect
answer ? why ?


i am currently trying to set
Settings::instance().evaluationDate() =  ??

 which date should i insert ? 15,June,2010 or 15,June,2011
 as I have set the duration to 1 year.. ??



Simon Ibbotson-2 wrote:

>
> Try setting the evaluation date at a global level... using
> Settings::instance().evaluationDate() =
>
>  
>
> Then let us know what the result is.
>
>  
>
> ________________________________
>
> From: Hayyan Rafiq [mailto:[hidden email]]
> Sent: 18 October 2010 15:53
> To: Simon Ibbotson
> Subject: RE: [Quantlib-users] Calculating yield to maturity ,
incorrect

> answer ? why ?
>
>  
>
>
>
>> Subject: RE: [Quantlib-users] Calculating yield to maturity ,
> incorrect answer ? why ?
>> Date: Mon, 18 Oct 2010 15:46:35 +0100
>> From: [hidden email]
>> To: [hidden email]
>>
>> Attaching the code would be useful...
>>
>> -----Original Message-----
>> From: johnacandy [mailto:[hidden email]]
>> Sent: 18 October 2010 15:42
>> To: [hidden email]
>> Subject: [Quantlib-users] Calculating yield to maturity , incorrect
>> answer ? why ?
>>
>>
>> I was hoping you folks could help me out , as i dont know peoole who
> are
>> familiar with quantlib ,I checked an example out and i wrote down a
> code
>> in
>> VS2010 C++ and boost + quanlib.
>> I have attached the code in a noted pad unfortunately i am not
>> getting the required answer , hope you could help me out
>>
>> Now i have the following requirement :
>>
>> Current Price = 90
>> Par Value = 100
>> Coupon Rate = 5 %
>> Years to maturity = 1
>>
>> >From the above data an online calculator calculates the Yield to
>> maturity to
>> be = 16.667
>>
>> However the program i wrote gives 1.769. :(
>>
>> The code i wrote is attached with this email , i dont know where i am
>> going
>> wrong , could you kindly go through the program and let me know what
i

>> am
>> doing wrong , i need to readjust the above mentioned program to
> display
>> 16.6... something... Hope you could help me out...
>>
>> I have used the calculator at
>> http://www.investopedia.com/calculator/AOYTM.aspx
>> with the values
>> 100
>> 90
>> 5
>> 1
>> (select Annually)
>> and it gives 16.67
>> and thats what i want.
>> I have emailed you the code i am using on the notepad file... Plz
take
>> some
>> time to go through it. I bet i must have made a very silly mistake...
>> Thanks again
>> --
>> View this message in context:
>>
>
http://old.nabble.com/Calculating-yield-to-maturity-%2C-incorrect-answer
>> ---why---tp29991145p29991145.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
>>
>>
>>
>> This communication and any attachments contains information which is
> confidential and may be subject to legal privilege. It is for intended
> recipients only. If you are not the intended recipient you must not
> copy, distribute, publish, rely on or otherwise use it without our
> consent. Some of our communications may contain confidential
information
> which it could be a criminal offence for you to disclose or use
without
> authority. If you have received this email in error please notify
> [hidden email] immediately and delete the email from your
> computer.
>>
>> The FSA reserves the right to monitor all email communications for
> compliance with legal, regulatory and professional standards.
>> This email is not intended to nor should it be taken to create any
> legal relations or contractual relationships. This email has
originated

> from
>>
>> The Financial Services Authority (FSA)
>> 25 The North Colonnade,
>> Canary Wharf,
>> London
>> E14 5HS
>> United Kingdom
>>
>> Registered as a Limited Company in England and Wales No.1920623.
>> Registered Office as above
>>
>> Switchboard: 020 7066 1000
>> Web Site: http://www.fsa.gov.uk
>> *****************************************************************
>>
>
>
>
------------------------------------------------------------------------
------
> 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---tp29991145p29991643.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