Login  Register

SwapIndex Calendar issue

Posted by Luca Billi on Jun 18, 2011; 1:44pm
URL: http://quantlib.414.s1.nabble.com/SwapIndex-Calendar-issue-tp11741.html

Hi all,

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