aboutsummaryrefslogtreecommitdiffstats
path: root/python/notebooks/Option Trades.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'python/notebooks/Option Trades.ipynb')
-rw-r--r--python/notebooks/Option Trades.ipynb8
1 files changed, 5 insertions, 3 deletions
diff --git a/python/notebooks/Option Trades.ipynb b/python/notebooks/Option Trades.ipynb
index 6d60669c..6a28003f 100644
--- a/python/notebooks/Option Trades.ipynb
+++ b/python/notebooks/Option Trades.ipynb
@@ -40,9 +40,11 @@
" vol_shock = np.arange(-.15, .31, 0.01)\n",
" spread_shock = np.arange(shock_min, shock_max, 0.01)\n",
" index = portf.indices[0].index_type\n",
- " vs = BlackSwaptionVolSurface(index, portf.indices[0].series, \n",
- " value_date=portf.value_date)\n",
- " vol_surface = vs[vs.list(option_type='payer')[-1]]\n",
+ " vol_surface = {}\n",
+ " for trade in portf.swaptions:\n",
+ " vs = BlackSwaptionVolSurface(trade.index.index_type, trade.index.series, \n",
+ " value_date=date)\n",
+ " vol_surface[trade.index.index_type + trade.index.series] = vs[vs.list(option_type='payer')[-1]]\n",
" \n",
" df = run_portfolio_scenarios(portf, date_range, params=[\"pnl\",\"delta\"],\n",
" spread_shock = spread_shock,\n",