diff options
Diffstat (limited to 'python/analytics')
| -rw-r--r-- | python/analytics/__init__.py | 3 | ||||
| -rw-r--r-- | python/analytics/option.py | 5 | ||||
| -rw-r--r-- | python/analytics/portfolio.py | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/python/analytics/__init__.py b/python/analytics/__init__.py index da3b5ae7..1dc1e24f 100644 --- a/python/analytics/__init__.py +++ b/python/analytics/__init__.py @@ -1,5 +1,6 @@ from .index import Index, ForwardIndex -from .option import BlackSwaption, Swaption, VolatilitySurface, ATMstrike, ProbSurface, QuoteSurface, VolSurface +from .option import (BlackSwaption, Swaption, ATMstrike, ProbSurface, + QuoteSurface, VolSurface, BlackSwaptionVolSurface) from .portfolio import Portfolio from .basket_index import MarkitBasketIndex from .tranche_basket import TrancheBasket diff --git a/python/analytics/option.py b/python/analytics/option.py index 4721dfbc..949ea224 100644 --- a/python/analytics/option.py +++ b/python/analytics/option.py @@ -596,7 +596,6 @@ class ModelBasedVolSurface(VolSurface): ax.set_ylabel("Moneyness") ax.set_zlabel("Volatility") - class BlackSwaptionVolSurface(ModelBasedVolSurface): pass @@ -702,10 +701,10 @@ def calib_sabr(x, option, strikes, pv, beta): r[i] = option.pv - pv[i] return r -class SABRVolatilitySurface(VolatilitySurface): +class SABRVolSurface(VolSurface): def __init__(self, index_type, series, tenor='5yr', trade_date=datetime.date.today(), beta=None): - VolatilitySurface.__init__(self, index_type, series, tenor='5yr', + VolSurface.__init__(self, index_type, series, tenor='5yr', trade_date=datetime.date.today()) if index_type == "HY": self.beta = 3.19 diff --git a/python/analytics/portfolio.py b/python/analytics/portfolio.py index 50b43477..bea0f5cd 100644 --- a/python/analytics/portfolio.py +++ b/python/analytics/portfolio.py @@ -1,5 +1,5 @@ from .index import Index -from .option import BlackSwaption, VolatilitySurface +from .option import BlackSwaption, BlackSwaptionVolSurface from db import dbengine from warnings import warn import pandas as pd @@ -87,7 +87,7 @@ class Portfolio: k = (index.trade_date, index_type, series, tenor) if self.swaptions: if k not in self._vs: - vs = VolatilitySurface(index_type, series, tenor, index.trade_date) + vs = BlackSwaptionVolSurface(index_type, series, tenor, index.trade_date) if surface_id is None: for source in source_list: if len(vs.list(source, option_type, model)) >=1: |
