diff options
Diffstat (limited to 'python/analytics/curve_trades.py')
| -rw-r--r-- | python/analytics/curve_trades.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/python/analytics/curve_trades.py b/python/analytics/curve_trades.py index 9fe7da00..81856628 100644 --- a/python/analytics/curve_trades.py +++ b/python/analytics/curve_trades.py @@ -1,4 +1,5 @@ -from analytics.index_data import get_index_quotes, index_returns +from .index_data import get_index_quotes, index_returns +from . import on_the_run from db import serenitas_engine, dawn_engine from analytics import CreditIndex, Portfolio from analytics.utils import roll_date @@ -17,13 +18,6 @@ import statsmodels.formula.api as smf import numpy as np import matplotlib.pyplot as plt -def on_the_run(index, value_date=datetime.date.today()): - r = serenitas_engine.execute("SELECT max(series) FROM index_maturity WHERE index=%s " - "and issue_date <= %s", - (index, value_date)) - series, = r.fetchone() - return series - def curve_spread_diff(index='IG', rolling=6, years=3, percentage=False, percentage_base='5yr'): otr = on_the_run(index) |
