Login  Register

Re: SwapIndex Calendar issue

Posted by Luigi Ballabio on Jul 15, 2011; 12:01pm
URL: http://quantlib.414.s1.nabble.com/SwapIndex-Calendar-issue-tp11741p11742.html


Hi Luca,
        thanks for the heads-up.  I don't have a fix yet, but I'll let you know
when it's done.

Luigi


On Sat, 2011-06-18 at 09:44 -0400, Luca Billi wrote:

> I just found that when building a term structure from a USD Libor Swap
> Index and then re-evaluating the same Swap Index, the original quote
> is not always recovered.
>
> This happens only on particular evaluation dates and it seems to be
> caused by a misalignment of the fixing calendars in the underlying
> swaps generated by the classes "SwapIndex" and "SwapRateHelper".
>
> More precisely, the underlying swap in "SwapRateHelper" inherits the
> fixing calendar from the underlying "IborIndex" not from the
> "SwapIndex". In the case of USD, "IborIndex" and "SwapIndex" calendars
> are different.
>
> Here's a code sample that illustrates the issue.
> Changing eDate to a different value makes the issue disappear.
>
>
> Date eDate(29, Dec, 2011);
>
> Settings::instance().evaluationDate() = eDate;
>
> double swaprate = 0.0500;
> Period term = 2*Years;
>
> boost::shared_ptr<RateHelper> s2y(new SwapRateHelper(swaprate,
>
> boost::shared_ptr<SwapIndex>(
>                                                            new
> UsdLiborSwapIsdaFixAm(term))));
>
> std::vector<boost::shared_ptr<RateHelper> > instruments;
> instruments.push_back(s2y);
>
> boost::shared_ptr<YieldTermStructure> curve(
>             new PiecewiseYieldCurve<Discount,LogLinear>(
>                                     0,
>                                     NullCalendar(),
>                                     instruments,
>                                     ActualActual(ActualActual::ISDA)));
>
> std::cout << UsdLiborSwapIsdaFixAm(term,
> Handle<YieldTermStructure>(curve)).fixing(eDate) << std::endl;
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> QuantLib-dev mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev

--

When I was a boy of fourteen, my father was so ignorant I could hardly
stand to have the old man around. But when I got to be twenty-one, I
was astonished at how much the old man had learned in seven years.
-- Mark Twain



------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev