diff options
| author | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-07-11 10:41:44 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-07-11 16:21:24 -0400 |
| commit | 0059feac1aa6d44be9e0f9fdcb7fdf03779eddbc (patch) | |
| tree | 1574d7263af3271f8cb0b31ac0ab690ea7ad6eb3 /legs.pyx | |
| parent | 36f6bec51667a7df7606eba7d53879dca54a1575 (diff) | |
| download | pyisda-0059feac1aa6d44be9e0f9fdcb7fdf03779eddbc.tar.gz | |
add a consctructor for ZeroCurve and rename it to YieldCurve
Diffstat (limited to 'legs.pyx')
| -rw-r--r-- | legs.pyx | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 |
