aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics/portfolio.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics/portfolio.py')
-rw-r--r--python/analytics/portfolio.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/python/analytics/portfolio.py b/python/analytics/portfolio.py
index bea0f5cd..fd73e0e5 100644
--- a/python/analytics/portfolio.py
+++ b/python/analytics/portfolio.py
@@ -33,14 +33,14 @@ class Portfolio:
self.trades = trades
self.indices = [t for t in trades if isinstance(t, Index)]
self.swaptions = [t for t in trades if isinstance(t, BlackSwaption)]
- trade_dates = set(index.trade_date for index in self.indices)
+ value_dates = set(index.value_date for index in self.indices)
self._keys = [(index.index_type, index.series, index.tenor) for index in self.indices]
for swaption in self.swaptions:
- trade_dates.add(swaption.index.trade_date)
- self._trade_date = trade_dates.pop()
- if len(trade_dates) >= 1:
+ value_dates.add(swaption.index.value_date)
+ self._value_date = value_dates.pop()
+ if len(value_dates) >= 1:
warn("not all instruments have the same trade date, picking {}".
- format(self._trade_date))
+ format(self._value_date))
self._vs = {}
@property
@@ -64,18 +64,18 @@ class Portfolio:
t.reset_pv()
@property
- def trade_date(self):
- return self._trade_date
+ def value_date(self):
+ return self._value_date
- @trade_date.setter
- def trade_date(self, d):
+ @value_date.setter
+ def value_date(self, d):
#we try to keep everybody in sync
for index in self.indices:
- index.trade_date = d
+ index.value_date = d
if len(self.indices) == 0:
for swaption in self.swaptions:
- self.swaption.trade_date = d
- self._trade_date = d
+ self.swaption.value_date = d
+ self._value_date = d
def mark(self, source_list=[], option_type=None, model="black", surface_id=None):
#add None so that we always try everything