aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics/index_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics/index_data.py')
-rw-r--r--python/analytics/index_data.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/analytics/index_data.py b/python/analytics/index_data.py
index 22862bdf..8e6eda32 100644
--- a/python/analytics/index_data.py
+++ b/python/analytics/index_data.py
@@ -132,15 +132,16 @@ def get_singlenames_quotes(indexname, date):
c.execute("SELECT * FROM curve_quotes(%s, %s)", vars=(indexname, date))
return [r for r in c]
-def build_curve(r, today_date, yc, start_date, step_in_date, value_date, end_dates):
+def build_curve(r, tenors, currency="USD"):
spread_curve = 1e-4 * np.array(r['spread_curve'], dtype='float')
upfront_curve = 1e-2 * np.array(r['upfront_curve'], dtype='float')
recovery_curve = np.array(r['recovery_curve'], dtype='float')
+ yc = get_curve(r['date'], currency)
try:
- sc = SpreadCurve(today_date, yc, start_date, step_in_date, value_date,
- end_dates, spread_curve, upfront_curve, recovery_curve,
+ sc = SpreadCurve(r['date'], yc, None, None, None,
+ tenors, spread_curve, upfront_curve, recovery_curve,
ticker=r['cds_ticker'])
- if len(sc) != end_dates.shape[0]:
+ if len(sc) != tenors.shape[0]:
sc = fill_curve(sc, end_dates)
except ValueError as e:
print(r[0], e)