aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics')
-rw-r--r--python/analytics/scenarios.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/analytics/scenarios.py b/python/analytics/scenarios.py
index 0c132076..ab0cdde3 100644
--- a/python/analytics/scenarios.py
+++ b/python/analytics/scenarios.py
@@ -9,7 +9,7 @@ from functools import partial
from multiprocessing import Pool
def run_swaption_scenarios(swaption, date_range, spread_shock, vol_shock,
- vol_surface, params=["pv"]):
+ vol_surface, params=["pv"], vol_time_roll=True):
"""computes the pv of a swaption for a range of scenarios
Parameters
@@ -24,11 +24,12 @@ def run_swaption_scenarios(swaption, date_range, spread_shock, vol_shock,
"""
swaption = deepcopy(swaption)
spreads = swaption.ref * (1 + spread_shock)
+ T = swaption.T
r = []
for date in date_range:
swaption.index.trade_date = date.date()
- T = swaption.T
+ if vol_time_roll: T = swaption.T
for s in spreads:
swaption.ref = s
curr_vol = max(0, float(vol_surface(T, swaption.moneyness)))