aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/analytics/option.py2
-rw-r--r--python/analytics/portfolio.py7
2 files changed, 5 insertions, 4 deletions
diff --git a/python/analytics/option.py b/python/analytics/option.py
index 9303576f..b15d3e81 100644
--- a/python/analytics/option.py
+++ b/python/analytics/option.py
@@ -805,7 +805,7 @@ class ProbSurface(QuoteSurface):
y = np.arange(min, max, 0.1)
x = np.arange(time[0], time[-1], 0.01)
xx, yy = np.meshgrid(x, y)
- z = np.vstack([expit(surf(xx, y)) for xx in x])
+ z = np.vstack([expit(surf(xx, np.log(y))) for xx in x])
surf = ax.plot_surface(xx, yy, z.T,
cmap=cm.viridis)
ax.set_xlabel("Year fraction")
diff --git a/python/analytics/portfolio.py b/python/analytics/portfolio.py
index 583f5582..508201f1 100644
--- a/python/analytics/portfolio.py
+++ b/python/analytics/portfolio.py
@@ -151,17 +151,18 @@ class Portfolio:
def _todf(self):
headers = ["Product", "Index", "Notional", "Ref", "Strike", "Direction",
- "Expiry", "Vol", "PV", "Delta", "Gamma", "Theta", "Vega"]
+ "Type", "Expiry", "Vol", "PV", "Delta", "Gamma", "Theta",
+ "Vega"]
rec = []
for t in self.trades:
if isinstance(t, Index):
name = f"{t.index_type}{t.series} {t.tenor}"
r = ("Index", name,
- t.notional, t.ref, "N/A", t.direction, "N/A", None, t.pv, 1., 0., t.theta, 0.)
+ t.notional, t.ref, "N/A", t.direction, "N/A", "N/A", None, t.pv, 1., 0., t.theta, 0.)
elif isinstance(t, BlackSwaption):
name = f"{t.index.index_type}{t.index.series} {t.index.tenor}"
r = ("Swaption", name,
- t.notional, t.ref, t.strike, t.direction, t.forward_date, t.sigma, t.pv,
+ t.notional, t.ref, t.strike, t.direction, t.option_type, t.forward_date, t.sigma, t.pv,
t.delta, t.gamma, t.theta, t.vega)
else:
raise TypeError