diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2022-02-03 13:21:26 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2022-02-03 13:21:26 -0500 |
| commit | 4448f9f90191a93b5e77ff091d2a91f408ed6575 (patch) | |
| tree | 6fa2997787efadc068be2cfab25cb556aa24ecc0 | |
| parent | b15637cd791215c945c2f67b31e29de51642b5a4 (diff) | |
| download | pyisda-4448f9f90191a93b5e77ff091d2a91f408ed6575.tar.gz | |
add function
| -rw-r--r-- | pyisda/date.pyx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pyisda/date.pyx b/pyisda/date.pyx index 2a31ef2..bc4507a 100644 --- a/pyisda/date.pyx +++ b/pyisda/date.pyx @@ -204,3 +204,11 @@ def default_accrual(trade_date, edd, start_date, end_date, double notional, &default_accrual) != SUCCESS: raise ValueError("failed to compute default accrual") return accrual_days, default_accrual + +def add_bus_days(from_date: datetime.date, int offset): + cdef: + TDate from_date_c = pydate_to_TDate(from_date) + TDate result + + JpmcdsDateFromBusDaysOffset(from_date_c, offset, b"None", &result) + return TDate_to_pydate(result) |
