diff options
Diffstat (limited to 'python/analytics')
| -rw-r--r-- | python/analytics/portfolio.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/analytics/portfolio.py b/python/analytics/portfolio.py index ceef78c6..b797fb50 100644 --- a/python/analytics/portfolio.py +++ b/python/analytics/portfolio.py @@ -96,8 +96,9 @@ class Portfolio: break else: raise ValueError("No market data available for this day") - surface_id = vs.list(source, option_type, model)[-1] - self._vs[k] = vs[surface_id] + self._vs[k] = vs[vs.list(source, option_type, model)[-1]] + else: + self._vs[k] = vs[surface_id] for swaption in self.swaptions: vol_surface = self._vs[(swaption.index.trade_date, ) + \ _key_from_index(swaption.index)] |
