diff options
| -rw-r--r-- | python/tests/test_upfront_cds.py | 8 | ||||
| -rw-r--r-- | python/tests/test_yieldcurve.py | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/python/tests/test_upfront_cds.py b/python/tests/test_upfront_cds.py index 1782ddc5..05c2e171 100644 --- a/python/tests/test_upfront_cds.py +++ b/python/tests/test_upfront_cds.py @@ -1,8 +1,8 @@ from quantlib.time.api import (WeekendsOnly, today, Years, Months, Period, Date, Actual365Fixed, Actual360, Quarterly, Following, Unadjusted, Schedule, - CDS, pydate_from_qldate) -from quantlib.instruments.api import CreditDefaultSwap, SELLER, BUYER + pydate_from_qldate, Rule) +from quantlib.instruments.api import CreditDefaultSwap, Side from quantlib.pricingengines.credit.isda_cds_engine import ( IsdaCdsEngine, ForwardsInCouponPeriod, NumericalFix, AccrualBias) from quantlib.termstructures.default_term_structure import DefaultProbabilityTermStructure @@ -24,7 +24,7 @@ def snac_pv(spread, term_date, fixed_coupon=0.01, recovery=0.4, ts=YC()): settings = Settings() calendar = WeekendsOnly() cds_helper = SpreadCdsHelper(spread, Period(57, Months), 1, calendar, - Quarterly, Following, CDS, Actual360(), recovery, ts, + Quarterly, Following, Rule.CDS, Actual360(), recovery, ts, lastperiod = Actual360(True)) cds_helper.set_isda_engine_parameters(int(NumericalFix.Taylor), int(AccrualBias.HalfDayBias), int(ForwardsInCouponPeriod.Flat)) @@ -35,7 +35,7 @@ def snac_pv(spread, term_date, fixed_coupon=0.01, recovery=0.4, ts=YC()): accrual_bias=AccrualBias.HalfDayBias) protect_start = settings.evaluation_date + 1 cds_schedule = Schedule(protect_start, term_date, Period(Quarterly), calendar, - Following, Unadjusted, CDS) + Following, Unadjusted, Rule.CDS) cds_trade = CreditDefaultSwap(BUYER, 100, fixed_coupon, cds_schedule, Following, Actual360(), protection_start = protect_start, last_period_day_counter = Actual360(True)) diff --git a/python/tests/test_yieldcurve.py b/python/tests/test_yieldcurve.py index 7f633af5..21693b77 100644 --- a/python/tests/test_yieldcurve.py +++ b/python/tests/test_yieldcurve.py @@ -1,6 +1,6 @@ import unittest from quantlib.time.api import ( - Date, Period, Quarterly, Schedule, CDS, WeekendsOnly, + Date, Period, Quarterly, Schedule, Rule, WeekendsOnly, Following, Unadjusted) from quantlib.settings import Settings import sys @@ -26,7 +26,7 @@ class TestYieldCurve(unittest.TestCase): term_date = Date(20, 6, 2021) cds_schedule = Schedule.from_rule( settings.evaluation_date, term_date, Period(Quarterly), - WeekendsOnly(), Following, Unadjusted, CDS) + WeekendsOnly(), Following, Unadjusted, Rule.CDS2015) curve_df = [curve.discount(d) for d in cds_schedule[1:-1]] #last date is term_date+1 curve_df.append(curve.discount(term_date+1)) |
