diff options
| author | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-07-26 17:16:41 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-07-26 17:16:41 -0400 |
| commit | d3c91158116fc3c5189d38ebf92de07bda44998b (patch) | |
| tree | 5ab263fbb58bb44a175e43e7e043e55bbae4ac0c | |
| parent | 148cd2fad20fe6f9a17a8df14d66cb63fc918336 (diff) | |
| download | pyisda-d3c91158116fc3c5189d38ebf92de07bda44998b.tar.gz | |
try to be more compliant
| -rw-r--r-- | pyisda/curve.pyx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 7a7ce05..6ceee57 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -1,4 +1,5 @@ from libc.stdlib cimport malloc, free + from curve cimport (JpmcdsBuildIRZeroCurve, JpmcdsZeroPrice, JpmcdsMakeTCurve, Basis, CONTINUOUS, JpmcdsCleanSpreadCurve) from date cimport (JpmcdsStringToDateInterval, pydate_to_TDate, dcc, @@ -89,11 +90,16 @@ cdef class YieldCurve(Curve): raise ValueError cdef TDateInterval tmp + cdef long period_adjust for i, p in enumerate(periods): period_bytes = p.encode('utf-8') if JpmcdsStringToDateInterval(period_bytes, routine, &tmp) != SUCCESS: raise ValueError - if JpmcdsDateFwdThenAdjust(settle_date, &tmp, MODIFIED, + if types[i] == 'M': + period_adjust = MODIFIED + else: + priod_adjust = NONE + if JpmcdsDateFwdThenAdjust(settle_date, &tmp, period_adjust, "None", &self._dates[i]) != SUCCESS: raise ValueError('Invalid interval') |
