diff options
| -rw-r--r-- | pyisda/curve.pxd | 1 | ||||
| -rw-r--r-- | pyisda/curve.pyx | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/pyisda/curve.pxd b/pyisda/curve.pxd index d996a68..c885d10 100644 --- a/pyisda/curve.pxd +++ b/pyisda/curve.pxd @@ -184,6 +184,7 @@ cdef extern from "isda/tcurve.h" nogil: cdef extern from "isda/cxzerocurve.h" nogil: double JpmcdsZeroPrice(TCurve* curve, TDate date) double JpmcdsForwardZeroPrice(TCurve* curve, TDate startDate, TDate maturityDate) + double JpmcdsLogForwardZeroPrice(const TCurve*, TDate startDate, TDate maturityDate) double JpmcdsZeroRate(TCurve* curve, TDate date) cdef double survival_prob(TCurve* curve, TDate start_date, TDate maturity_date, double eps) nogil diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 08d0c77..a9cbbcf 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -859,16 +859,16 @@ cdef class SpreadCurve(Curve): @cython.cdivision(True) @cython.boundscheck(False) -cdef TCurve* _fill_curve(TCurve* sc, TDate* end_dates, int n_dates) nogil: +cdef TCurve* _fill_curve(const TCurve* sc, const TDate* end_dates, int n_dates) nogil: cdef: size_t i TDate base_date = sc.fBaseDate double t - TCurve* curve = JpmcdsNewTCurve(base_date, n_dates, 5000., 2) + TCurve* curve = JpmcdsNewTCurve(base_date, n_dates, <double>CONTINUOUS, 2) TRatePt* it = curve.fArray for i in range(n_dates): t = (end_dates[i] - base_date)/365. it[i].fDate = end_dates[i] - it[i].fRate = -log(JpmcdsForwardZeroPrice(sc, base_date, end_dates[i])) / t + it[i].fRate = -JpmcdsLogForwardZeroPrice(sc, base_date, end_dates[i]) / t return curve |
