Posted by
Peter Caspers-4 on
Oct 07, 2012; 6:49pm
URL: http://quantlib.414.s1.nabble.com/CDS-last-period-tp13598.html
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
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev