aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/tests/test_upfront_cds.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/python/tests/test_upfront_cds.py b/python/tests/test_upfront_cds.py
index 1ad88ccd..6c6deae0 100644
--- a/python/tests/test_upfront_cds.py
+++ b/python/tests/test_upfront_cds.py
@@ -13,7 +13,7 @@ from quantlib.time.api import (
Schedule,
DateGeneration,
)
-from quantlib.instruments.api import CreditDefaultSwap, Side
+from quantlib.instruments.api import CreditDefaultSwap, Protection
from quantlib.pricingengines.credit.isda_cds_engine import (
IsdaCdsEngine,
ForwardsInCouponPeriod,
@@ -82,7 +82,7 @@ def snac_pv(spread, term_date, fixed_coupon=0.01, recovery=0.4, ts=YC()):
DateGeneration.CDS,
)
cds_trade = CreditDefaultSwap(
- Side.Buyer,
+ Protection.Buyer,
100,
fixed_coupon,
cds_schedule,
@@ -115,6 +115,7 @@ def jpmorgan_curves(trade_date, value_date, start_date, end_date, spread, recove
if __name__ == "__main__":
+ breakpoint()
settings = Settings()
settings.evaluation_date = Date(21, 5, 2009)
yield_helpers = rate_helpers()
@@ -145,7 +146,7 @@ if __name__ == "__main__":
DateGeneration.CDS,
)
cds_trade = CreditDefaultSwap.from_upfront(
- Side.Buyer,
+ Protection.Buyer,
10000000,
0.0,
0.01,
@@ -166,7 +167,7 @@ if __name__ == "__main__":
cds_trade.set_pricing_engine(isda_pricer)
cds_trade2 = CreditDefaultSwap(
- Side.BUYER,
+ Protection.Buyer,
10000000,
spread,
cds_schedule,
@@ -184,11 +185,11 @@ if __name__ == "__main__":
# hazard_rate = 0.12649393489974806
# cds_trade.set_pricing_engine(isda_pricer)
- # cds_trade2 = CreditDefaultSwap.from_upfront(BUYER, 10000000, 0., 0.01, cds_schedule,
+ # cds_trade2 = CreditDefaultSwap.from_upfront(Buyer, 10000000, 0., 0.01, cds_schedule,
# Following, Actual360(),
# protection_start = Date.from_datetime(trade_date) + 1,
# last_period_day_counter = Actual360(True))
- # cds_trade3 = CreditDefaultSwap(BUYER, 10000000, 0.05, cds_schedule,
+ # cds_trade3 = CreditDefaultSwap(Buyer, 10000000, 0.05, cds_schedule,
# Following, Actual360(),
# protection_start = Date.from_datetime(trade_date) + 1,
# last_period_day_counter = Actual360(True))