aboutsummaryrefslogtreecommitdiffstats
path: root/python/index_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/index_data.py')
-rw-r--r--python/index_data.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/index_data.py b/python/index_data.py
index 21e202b6..dbe60a2e 100644
--- a/python/index_data.py
+++ b/python/index_data.py
@@ -134,9 +134,9 @@ def get_singlenames_quotes(indexname, date):
return [r for r in c]
def build_curve(r, today_date, yc, start_date, step_in_date, value_date, end_dates):
- spread_curve = 1e-4 * np.array(r['spread_curve'][1:], dtype='float')
- upfront_curve = 1e-2 * np.array(r['upfront_curve'][1:], dtype='float')
- recovery_curve = np.array(r['recovery_curve'][1:], dtype='float')
+ 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')
try:
sc = SpreadCurve(today_date, yc, start_date, step_in_date, value_date,
end_dates, spread_curve, upfront_curve, recovery_curve,
@@ -159,14 +159,14 @@ def build_curves_dist(quotes, args, workers=4):
return r
def get_singlenames_curves(index_type, series, trade_date):
- end_dates = roll_date(trade_date, [1, 2, 3, 4, 5, 7, 10], nd_array=True)
+ end_dates = roll_date(trade_date, [0.5, 1, 2, 3, 4, 5, 7, 10], nd_array=True)
sn_quotes = get_singlenames_quotes("{}{}".format(index_type.lower(), series),
trade_date.date())
currency = "EUR" if index_type in ["XO", "EU"] else "USD"
jp_yc = get_curve(trade_date, currency)
start_date = previous_twentieth(trade_date)
step_in_date = trade_date + datetime.timedelta(days=1)
- value_date = pd.Timestamp(trade_date) + 3* BDay()
+ value_date = pd.Timestamp(trade_date) + 3 * BDay()
args = (trade_date, jp_yc, start_date, step_in_date, value_date, end_dates)
curves = build_curves_dist(sn_quotes, args)
return curves, args