diff options
| -rw-r--r-- | pyisda/curve.pxd | 15 | ||||
| -rw-r--r-- | pyisda/curve.pyx | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/pyisda/curve.pxd b/pyisda/curve.pxd index d996a68..05a5995 100644 --- a/pyisda/curve.pxd +++ b/pyisda/curve.pxd @@ -189,6 +189,14 @@ cdef extern from "isda/cxzerocurve.h" nogil: cdef double survival_prob(TCurve* curve, TDate start_date, TDate maturity_date, double eps) nogil cdef extern from "isda/cfinanci.h": + cdef enum Compounding: + CONTINUOUS "JPMCDS_CONTINUOUS_BASIS" + DISCOUNT_RATE "JPMCDS_DISCOUNT_RATE" + SIMPLE_RATE "JPMCDS_SIMPLE_RATE" + ANNUAL_BASIS "JPMCDS_ANNUAL_BASIS" + DISCOUNT_FACTOR "JPMCDS_DISCOUNT_FACTOR" + + int JpmcdsDiscountToRateYearFrac(double discount, # (I) Discount factor double yearFraction, # (I) See JpmcdsDayCountFraction double basis, # (I) Basis for the rate @@ -196,13 +204,6 @@ cdef extern from "isda/cfinanci.h": cdef extern from "isda/macros.h": cdef double JPMCDS_MAX_RATE -cdef enum Basis: - CONTINUOUS = 5000 - DISCOUNT_RATE = 512 - SIMPLE_BASIS = 0 - ANNUAL_BASIS = 1 - DISCOUNT_FACTOR = -2 - cdef extern from "<memory>" namespace "std" nogil: cdef cppclass shared_ptr[T]: ctypedef void (*D)(T*) diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 7c9a8f3..ade1de1 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -731,7 +731,7 @@ cdef class SpreadCurve(Curve): return r @classmethod - def from_flat_hazard(cls, base_date, double rate, Basis basis=CONTINUOUS, + def from_flat_hazard(cls, base_date, double rate, Compounding basis=CONTINUOUS, str day_count_conv='Actual/365F'): """ Alternative constructor for flat hazard rate Curve. |
