diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2019-09-20 14:50:24 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2019-09-20 14:50:32 -0400 |
| commit | 5ae5babc87fcbf60d73a3fb06d0e16afda1c3f81 (patch) | |
| tree | 057cee4de38205468e9af72f8d8a3a12067c4715 | |
| parent | 4e39f414c2f4f83b493aa4c05cbdf6fad11da13d (diff) | |
| download | pyisda-5ae5babc87fcbf60d73a3fb06d0e16afda1c3f81.tar.gz | |
allow to specify the stub type
| -rw-r--r-- | pyisda/legs.pyx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pyisda/legs.pyx b/pyisda/legs.pyx index 838ef7a..06b9680 100644 --- a/pyisda/legs.pyx +++ b/pyisda/legs.pyx @@ -95,15 +95,17 @@ cdef class FeeLeg: Default 'ACT/360' protect_start : bool, optional if True, protection starts at beginning of day. Default to True. + stub : string, one of 'f/s', 'b/s', 'f/l', 'b/l', optional + Default 'f/s' """ def __cinit__(self, start_date, end_date, bint pay_accrued_on_default, double notional, double coupon_rate, str payment_dcc='ACT/360', - bint protect_start=True): + bint protect_start=True, str stub="f/s"): cdef TStubMethod stub_type - if JpmcdsStringToStubMethod(b"f/s", &stub_type) != 0: - raise ValueError("can't convert stub") + if JpmcdsStringToStubMethod(stub, &stub_type) != 0: + raise ValueError(f"can't convert stub {stub}") self._thisptr = JpmcdsCdsFeeLegMake(pydate_to_TDate(start_date), pydate_to_TDate(end_date), |
