|
From: MonkeyMan <fee...@ya...> - 2010-08-10 11:22:26
|
Luigi Ballabio <luigi.ballabio <at> gmail.com> writes: > It's a calendar mismatch. USD libor is fixed in London and uses a > calendar which joins US and UK holidays. Makes sense. So I changed my date calculation to this: Calendar calendar = UnitedStates(); Date todaysDate(29, April, 2005); Integer fixingDays = 2; JointCalendar usdgbpCalendar = JointCalendar(UnitedStates(), UnitedKingdom()); Date settlementDate = usdgbpCalendar.advance(todaysDate, fixingDays, Days); settlementDate = usdgbpCalendar.adjust(settlementDate); Then I also changed my rate helpers for deposits and swaps to have the joined calendar: boost::shared_ptr<RateHelper> d1w(new DepositRateHelper( Handle<Quote>(d1wRate), 1*Weeks, fixingDays, usdgbpCalendar, Following, true, depositDayCounter)); and boost::shared_ptr<RateHelper> s2y(new SwapRateHelper( Handle<Quote>(s2yRate), 2*Years, usdgbpCalendar, swFixedLegFrequency, swFixedLegConvention, swFixedLegDayCounter, swFloatingLegIndex)); And my code doesn't blow up. One last question, though. When I'm building a new swap to price do I need to change both the fixed and floating calendars or only the floating calendar. Like this: Schedule fwdFixedSchedule(fwdStart, fwdMaturity, Period(fixedLegFrequency), calendar, fixedLegConvention, fixedLegConvention, DateGeneration::Forward, false); Schedule fwdFloatSchedule(fwdStart, fwdMaturity, Period(floatingLegFrequency), usdgbpCalendar, floatingLegConvention, floatingLegConvention, DateGeneration::Forward, false); It seems that since the standard is for the fixed leg to be unadjusted, I would just use the joined calendar for the floating leg, but I may be confusing conventions. Thanks for your help. I have been flailing around looking at day count conventions and in all the wrong places. Monkey |