diff options
| -rw-r--r-- | pyisda/credit_index.pyx | 6 | ||||
| -rw-r--r-- | pyisda/curve.pyx | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx index 0ce2161..cfc0b2e 100644 --- a/pyisda/credit_index.pyx +++ b/pyisda/credit_index.pyx @@ -535,7 +535,7 @@ cdef class CreditIndex(CurveList): 1.0, ACT_360, # ACT_360 MODIFIED, # MODIFIED - b'NONE', + self.cal_file.c_str(), True) else: fl = self.fee_legs[found] @@ -694,7 +694,7 @@ cdef class CreditIndex(CurveList): &stub_type, ACT_360, MODIFIED, - b'NONE', + self.cal_file.c_str(), yc.get_TCurve(), sc, <double*>(<char*>sc + self.offset_recovery_rates[p.second]), @@ -759,7 +759,7 @@ cdef class CreditIndex(CurveList): &stub_type, ACT_360, MODIFIED, - b'NONE', + self.cal_file.c_str(), yc.get_TCurve(), sc, recovery_rates, diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 924eeb8..182b7a7 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -615,7 +615,7 @@ cdef class SpreadCurve(Curve): seniority: Seniority, optional doc_clause: DocClause, optional fill_curve: bool, optional - calendar: bytes, optional default to "NONE" + calendar: str, optional default to "NONE" """ @cython.boundscheck(False) @@ -628,7 +628,7 @@ cdef class SpreadCurve(Curve): str ticker="", Seniority seniority=Senior, DocClause doc_clause=XR14, bint fill_curve=True, defaulted=None, - calendar=b"NONE"): + str calendar="NONE"): cdef TDate today_c = pydate_to_TDate(today) cdef TDate step_in_date_c @@ -653,7 +653,7 @@ cdef class SpreadCurve(Curve): else: step_in_date_c = pydate_to_TDate(step_in_date) if cash_settle_date is None: - JpmcdsDateFromBusDaysOffset(today_c, 3, "None", &cash_settle_date_c) + JpmcdsDateFromBusDaysOffset(today_c, 3, calendar, &cash_settle_date_c) else: cash_settle_date_c = pydate_to_TDate(cash_settle_date) @@ -953,7 +953,8 @@ cdef class SpreadCurve(Curve): @cython.boundscheck(False) def par_spread(self, today, step_in_date, start_date, end_dates, const double[:] recovery_rates, YieldCurve yc not None, - bint pay_accrued_on_default=True): + bint pay_accrued_on_default=True, + str calendar="NONE"): """ Parameters ---------- @@ -968,6 +969,7 @@ cdef class SpreadCurve(Curve): for i, d in enumerate(end_dates): end_dates_c[i] = pydate_to_TDate(d) cdef double* par_spreads + cdef const char* c_cal = calendar cdef TStubMethod stub_type if JpmcdsStringToStubMethod(b"f/s", &stub_type) != 0: @@ -987,7 +989,7 @@ cdef class SpreadCurve(Curve): &stub_type, ACT_360, MODIFIED, - b'NONE', + c_cal, yc.get_TCurve(), self.get_TCurve(), &recovery_rates[0], |
