aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics/index.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics/index.py')
-rw-r--r--python/analytics/index.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/python/analytics/index.py b/python/analytics/index.py
index 85842d15..75a3e0b2 100644
--- a/python/analytics/index.py
+++ b/python/analytics/index.py
@@ -21,25 +21,24 @@ from bbg_helpers import BBG_IP, retrieve_data, init_bbg_session
from yieldcurve import get_curve, rate_helpers, YC, ql_to_jp
from weakref import WeakSet
-def g(index, spread, exercise_date, forward_yc=None, pv=None):
+def g(index, spread, exercise_date, pv=None):
"""computes the strike clean price using the expected forward yield curve. """
- if forward_yc is None:
- forward_yc = index._yc
step_in_date = exercise_date + datetime.timedelta(days=1)
exercise_date_settle = pd.Timestamp(exercise_date) + 3 * BDay()
if spread is None and index._sc is not None:
sc = index._sc
- prot = index._default_leg.pv(exercise_date, step_in_date, exercise_date_settle, forward_yc,
+ prot = index._default_leg.pv(exercise_date, step_in_date,
+ exercise_date_settle, index._yc,
index._sc, index.recovery)
else:
rates = array.array('d', [spread * 1e-4])
upfront = 0. if pv is None else pv
- sc = SpreadCurve(exercise_date, forward_yc, index.start_date,
+ sc = SpreadCurve(exercise_date, index._yc, index.start_date,
step_in_date, exercise_date_settle,
[index.end_date], rates, array.array('d', [upfront]),
array.array('d', [index.recovery]))
a = index._fee_leg.pv(exercise_date, step_in_date, exercise_date_settle,
- forward_yc, sc, True)
+ index._yc, sc, True)
if pv is not None:
return 1e4 * pv / a + spread