From 0059feac1aa6d44be9e0f9fdcb7fdf03779eddbc Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Mon, 11 Jul 2016 10:41:44 -0400 Subject: add a consctructor for ZeroCurve and rename it to YieldCurve --- legs.pyx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'legs.pyx') diff --git a/legs.pyx b/legs.pyx index 0a07a9b..2df83e3 100644 --- a/legs.pyx +++ b/legs.pyx @@ -3,7 +3,7 @@ from legs cimport (JpmcdsCdsContingentLegMake, from libc.stdlib cimport free from date cimport pydate_to_TDate, TDate_to_pydate, dcc from cdsone cimport JpmcdsStringToStubMethod, TStubMethod -from curve cimport ZeroCurve, SpreadCurve +from curve cimport YieldCurve, SpreadCurve cdef class ContingentLeg: @@ -21,14 +21,14 @@ cdef class ContingentLeg: if self._thisptr is not NULL: free(self._thisptr) - def pv(self, today, step_in_date, value_date, ZeroCurve zc, SpreadCurve sc, + def pv(self, today, step_in_date, value_date, YieldCurve yc, SpreadCurve sc, double recovery_rate): cdef TDate today_c = pydate_to_TDate(today) cdef TDate step_in_date_c = pydate_to_TDate(step_in_date) cdef TDate value_date_c = pydate_to_TDate(value_date) cdef double pv if JpmcdsContingentLegPV(self._thisptr, today_c, value_date_c, step_in_date_c, - zc._thisptr, sc._thisptr, recovery_rate, &pv) == 0: + yc._thisptr, sc._thisptr, recovery_rate, &pv) == 0: return pv else: raise ValueError @@ -81,14 +81,14 @@ cdef class FeeLeg: result.append((TDate_to_pydate(cf.fDate), cf.fAmount)) return result - def pv(self, today, step_in_date, value_date, ZeroCurve zc, SpreadCurve sc, + def pv(self, today, step_in_date, value_date, YieldCurve yc, SpreadCurve sc, TBoolean pay_accrued_at_start): cdef TDate today_c = pydate_to_TDate(today) cdef TDate step_in_date_c = pydate_to_TDate(step_in_date) cdef TDate value_date_c = pydate_to_TDate(value_date) cdef double pv if JpmcdsFeeLegPV(self._thisptr, today_c, step_in_date_c, value_date_c, - zc._thisptr, sc._thisptr, pay_accrued_at_start, &pv) == 0: + yc._thisptr, sc._thisptr, pay_accrued_at_start, &pv) == 0: return pv else: raise ValueError -- cgit v1.2.3-70-g09d2