aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics/tranche_basket.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics/tranche_basket.py')
-rw-r--r--python/analytics/tranche_basket.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 1913c1d1..2f5cdb4d 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -17,12 +17,12 @@ import numpy as np
class TrancheBasket(BasketIndex):
def __init__(self, index_type: str, series: int, tenor: str, *,
- trade_date: pd.Timestamp=pd.Timestamp.today().normalize()):
- super().__init__(index_type, series, [tenor], trade_date=trade_date)
- self.tranche_quotes = get_tranche_quotes(index_type, series, tenor, trade_date.date())
+ value_date: pd.Timestamp=pd.Timestamp.today().normalize()):
+ super().__init__(index_type, series, [tenor], value_date=value_date)
+ self.tranche_quotes = get_tranche_quotes(index_type, series, tenor, value_date.date())
index_desc = self.index_desc.reset_index('maturity').set_index('tenor')
self.maturity = index_desc.loc[tenor].maturity
- self.start_date, self.cs = credit_schedule(trade_date, tenor[:-1], 1, self.yc, self.maturity)
+ self.start_date, self.cs = credit_schedule(value_date, tenor[:-1], 1, self.yc, self.maturity)
self.K_orig = np.hstack((0., self.tranche_quotes.detach)) / 100
self.K = adjust_attachments(self.K_orig, self.cumloss, self.factor)
if index_type == "HY":
@@ -55,7 +55,7 @@ class TrancheBasket(BasketIndex):
coupon,
recov)
self.tranche_quotes.running.iat[i] = coupon
- accrued = cds_accrued(self.trade_date, self.tranche_quotes.running)
+ accrued = cds_accrued(self.value_date, self.tranche_quotes.running)
self.tranche_quotes.quotes -= accrued
self._Ngh = 250
@@ -199,7 +199,7 @@ class TrancheBasket(BasketIndex):
def tranche_durations(self, complement=False):
cl = self.tranche_pvs(complement=complement).coupon_leg
- durations = (cl - cds_accrued(self.trade_date, self.tranche_quotes.running)) / \
+ durations = (cl - cds_accrued(self.value_date, self.tranche_quotes.running)) / \
self.tranche_quotes.running
durations.index = self._row_names
durations.name = 'duration'