summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--legs.pxd4
-rw-r--r--legs.pyx5
2 files changed, 9 insertions, 0 deletions
diff --git a/legs.pxd b/legs.pxd
index c9df02b..3d8d5bd 100644
--- a/legs.pxd
+++ b/legs.pxd
@@ -89,6 +89,10 @@ cdef extern from "isda/feeleg.h":
cdef void JpmcdsFeeLegFree(TFeeLeg *p)
+ cdef void FeeLegAI(TFeeLeg* fl,
+ TDate today,
+ double* ai)
+
cdef class ContingentLeg:
cdef TContingentLeg* _thisptr
diff --git a/legs.pyx b/legs.pyx
index 2df83e3..55f1fcb 100644
--- a/legs.pyx
+++ b/legs.pyx
@@ -93,6 +93,11 @@ cdef class FeeLeg:
else:
raise ValueError
+ def accrued(self, today):
+ cdef double ai
+ FeeLegAI(self._thisptr, pydate_to_TDate(today), &ai)
+ return ai
+
def __dealloc__(self):
if self._thisptr is not NULL:
JpmcdsFeeLegFree(self._thisptr)