Posted by
japari on
May 22, 2008; 8:56am
URL: http://quantlib.414.s1.nabble.com/CDS-tp11921p11923.html
This is what I used to do (removed the code to get this done by the
user-coupons) but only applies to the CDSs and it is not the 3rd Wedn rule.
Theres a broken period from "start date" to the (badly named) "first date"
Another feature to be added is the specific day count convention for CDS that
adds an extra day to the last coupon period. Again one can do it passing the
coupon schedule that way.
Rgds
pp
Date cdsFstDate;
if( (cds_start_date.month() == Month::March) ||
(cds_start_date.month() == Month::April) ||
(cds_start_date.month() == Month::May)){
cdsFstDate = Date(20, Month::June, cds_start_date.year());
}else if( (cds_start_date.month() == Month::June) ||
(cds_start_date.month() == Month::July) ||
(cds_start_date.month() == Month::August)){
cdsFstDate = Date(20, Month::September,
cds_start_date.year());
}else if( (cds_start_date.month() == Month::September) ||
(cds_start_date.month() == Month::October) ||
(cds_start_date.month() == Month::November)){
cdsFstDate = Date(20, Month::December,
cds_start_date.year());
}else if( (cds_start_date.month() == Month::December)) {
cdsFstDate = Date(20, Month::March, cds_start_date.year()+1);
}else if( (cds_start_date.month() == Month::January) ||
(cds_start_date.month() == Month::February)){
cdsFstDate = Date(20, Month::March, cds_start_date.year());
}
cdsFstDate = cal.adjust(cdsFstDate, bdc);
Quoting Simon Ibbotson <
[hidden email]>:
> There's a function in QuantLib for deriving the next CME IMM date (3rd
> Wednesday). Is there anything similar for other exchanges?
> In particular, most CDS roll on the 20th of the IMM month (except emerging
> markets which roll on the 20th of every month). I could write some external
> code, but I guessed that it would be better within QuantLib - anyone
> done/doing this?
>
> Cheers,
>
> Simon
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev