summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2018-11-09 13:54:37 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2018-11-09 13:54:37 -0500
commitf339ef35eb45e0f7874c578442baabc42950a868 (patch)
tree53db16fd88fbce0543fdb4b49d56ff13b0a85576
parentb25fc45c9fe68320137b4c52fb9e29ea103be3be (diff)
downloadpyisda-f339ef35eb45e0f7874c578442baabc42950a868.tar.gz
fix spread for defaulted curve
-rw-r--r--pyisda/curve.pxd3
-rw-r--r--pyisda/curve.pyx2
2 files changed, 4 insertions, 1 deletions
diff --git a/pyisda/curve.pxd b/pyisda/curve.pxd
index c7362c0..e0bb094 100644
--- a/pyisda/curve.pxd
+++ b/pyisda/curve.pxd
@@ -193,6 +193,9 @@ cdef extern from "isda/cfinanci.h":
double yearFraction, # (I) See JpmcdsDayCountFraction
double basis, # (I) Basis for the rate
double *rate) nogil
+cdef extern from "isda/macros.h":
+ cdef double JPMCDS_MAX_RATE
+
cdef enum Basis:
CONTINUOUS = 5000
DISCOUNT_RATE = 512
diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx
index f91a90c..6aa54a7 100644
--- a/pyisda/curve.pyx
+++ b/pyisda/curve.pyx
@@ -591,7 +591,7 @@ cdef class SpreadCurve(Curve):
<long>'M',
b'NONE')
else:
- rates = vector[double](n_dates, 1000)
+ rates = vector[double](n_dates, JPMCDS_MAX_RATE)
curve = JpmcdsMakeTCurve(today_c,
end_dates_c,
rates.data(),