diff options
Diffstat (limited to 'python/analytics/tranche_functions.py')
| -rw-r--r-- | python/analytics/tranche_functions.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/analytics/tranche_functions.py b/python/analytics/tranche_functions.py index 25020cd6..499bbc7e 100644 --- a/python/analytics/tranche_functions.py +++ b/python/analytics/tranche_functions.py @@ -304,14 +304,14 @@ def credit_schedule(tradedate, tenor, coupon, yc, enddate=None): return pydates[0], pd.DataFrame({"df": df, "coupons": coupons}, dates[1:]) -def cdsAccrued(tradedate, coupon): +def cds_accrued(tradedate, coupon): tradedate = pydate_to_qldate(tradedate) - end = tradedate + Period('3Mo') + end = tradedate + Period('3M') start_protection = tradedate + 1 DC = Actual360() - cal = UnitedStates() - sched = Schedule(start, end, Period('3Mo'), cal, date_generation_rule=CDS2015) + cal = WeekendsOnly() + sched = Schedule(tradedate, end, Period('3M'), cal, date_generation_rule=CDS2015) prevpaydate = sched.previous_date(tradedate) return DC.year_fraction(prevpaydate, start_protection) * coupon |
