diff options
| -rw-r--r-- | pyisda/legs.pyx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pyisda/legs.pyx b/pyisda/legs.pyx index 6decaa5..5b15cc8 100644 --- a/pyisda/legs.pyx +++ b/pyisda/legs.pyx @@ -32,14 +32,17 @@ cdef class ContingentLeg: free(self._thisptr) def __reduce__(self): - return (self.__class__, (TDate_to_pydate(self._thisptr.startDate), + return (self.__class__, (TDate_to_pydate(self._thisptr.startDate + + self._thisptr.protectStart), TDate_to_pydate(self._thisptr.endDate), self._thisptr.notional, self._thisptr.protectStart)) def __hash__(self): - return hash((self._thisptr.startDate, self._thisptr.endDate, - self._thisptr.notional, self._thisptr.protectStart)) + return hash((self._thisptr.startDate + self._thisptr.protectStart, + self._thisptr.endDate, + self._thisptr.notional, + self._thisptr.protectStart)) def pv(self, today, step_in_date, value_date, YieldCurve yc, SpreadCurve sc, double recovery_rate): |
