Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Relinkable-handle-problem-tp14264p14265.html
Hello,
there are a few issues in your code:
1) the particular one you're having about an empty handle is because
you didn't set any curve to the liborTermStructure handle;
2) the null values are because you didn't set the evaluation date.
You define a today, but you're missing the
Settings::instance().evaluationDate() = today;
that will cause the calculations to be done at that date.
3) your discount curve spans three years, but the bond matures beyond
that date. You can either add more points, or extrapolate by adding
the instruction
disTS->enableExtrapolation();
before starting the calculations;
4) you'll need another Libor fixing for July 17 2009.
With the above changes, your program runs correctly.
Hope this helps,
Luigi
On Tue, May 21, 2013 at 7:31 AM, Yuanhao Zhang <
[hidden email]> wrote:
> I am now following the sample case bond to learn QuantLib. Then, I changed
> the Discount Yield Curve as my own one. But, i met the problem. Seems the
> class relinkable handle link to an empty discount curve, the result is all
> null much different from the sample case. What was the problem, am I
> following the right way to link the discount curve?
> Hope someone can help me.
>
> regards
>
> Alex Zhang
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt!
http://p.sf.net/sfu/newrelic_d2d_may> _______________________________________________
> QuantLib-users mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-users>
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt!
http://p.sf.net/sfu/newrelic_d2d_may_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users