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.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/analytics/index_data.py b/python/analytics/index_data.py
index 9a68f3d5..18aeaaba 100644
--- a/python/analytics/index_data.py
+++ b/python/analytics/index_data.py
@@ -47,7 +47,7 @@ def insert_quotes():
def get_index_quotes(index=None, series=None, tenor=None, from_date=None,
- years=3, remove_holidays=True):
+ years=3, remove_holidays=True, source='MKIT'):
args = locals().copy()
del args['remove_holidays']
if args['years'] is not None:
@@ -69,7 +69,7 @@ def get_index_quotes(index=None, series=None, tenor=None, from_date=None,
where_clause = " AND ".join(make_str(k, v)
for k, v in args.items() if v is not None)
- sql_str = "SELECT * FROM index_quotes"
+ sql_str = "SELECT * FROM index_quotes_pre"
if where_clause:
sql_str = " WHERE ".join([sql_str, where_clause])
@@ -116,11 +116,11 @@ def index_returns(df=None, index=None, series=None, tenor=None, from_date=None,
df = get_index_quotes(index, series, tenor, from_date, years)
spread_return = (df.
groupby(level=['index', 'series', 'tenor', 'version']).
- closespread.
+ close_spread.
pct_change(periods=per))
price_return = (df.
groupby(level=['index', 'series', 'tenor', 'version']).
- closeprice.
+ close_price.
diff() / 100)
df = pd.concat([spread_return, price_return], axis=1,
keys=['spread_return', 'price_return'])