|
From: Peter C. <pca...@gm...> - 2012-10-07 18:50:05
|
Hi, the days in the last period of a CDS are usually counted as (d2-d1+1), i.e. including the first and the last date. I might miss something but this seems not possible in the current implementation of the credit default swap? This would be my plan to fix that: 1. Implement a new day counter Actual360Inc counting (d2-d1+1) days 2. Add a lastPeriodDC_ variable and withLastPeriodDayCounter() method to FixedRateLeg and extend the Leg() operator accordingly 3. Add a parameter const DayCounter& lastPeriodDayCounter = DayCounter() to the CreditDefaultSwap constructors and invoke withLastPeriodDayCounter(lastPeriodDayCounter) in the code if this parameter is not empty Maybe one could also default the dayCounter to Actual360() and the lastPeriodDayCounter to Actual360Inc() in the CreditDefaultSwap constructors already to match the usual use case? Does that make sense? Thank you Peter |