lballabio / QuantLib

The QuantLib C++ library
http://quantlib.org
Other
5.37k stars 1.8k forks source link

CDS valuation for 2 historical dates (19 jun 2009 and 19 mar 2010) #798

Open aleksejsk opened 4 years ago

aleksejsk commented 4 years ago

I bumped into a problem with historical CDS valuation as of 19 jun 2009 and 19 mar 2010. The easiest way to replicate is to take example provided and change row:

tradeDate = ql.Date(21,5,2009) to either of two dates (e.g. ql.Date(19,6,2009)). One should get:

"RuntimeError: contract cannot start before accrual"

On both of those dates it is a Friday which might give some hint. Have v 1.18

lballabio commented 4 years ago

Thanks. I'm moving the issue the QuantLib repo, since it's likely due to the code in the underlying C++ library.