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
>
> 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,
>
>
> E14 5HS
>
>
> Registered as a Limited Company in
> Registered Office as above
>
> Switchboard: 020 7066 1000
> Web Site: http://www.fsa.gov.uk
>
>
Free forum by Nabble | Disable Popup Ads | Edit this page |