diff options
| -rw-r--r-- | python/risk_insight/views.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/risk_insight/views.py b/python/risk_insight/views.py index 153bb63d..17ab6c9a 100644 --- a/python/risk_insight/views.py +++ b/python/risk_insight/views.py @@ -70,9 +70,13 @@ def get_indices_quotes(): sqlstr = "SELECT to_char(date, 'YYYY/MM/DD'), {0} " \ "from index_quotes WHERE index=%s and series=%s " \ "and tenor=%s ORDER BY date" - query_columns = {'quotes': "closeprice, modelprice", - 'adjquotes': "adjcloseprice, adjmodelprice", - 'basis': "closeprice-modelprice", + if index.upper() == "HY": + tail = "price" + else: + tail = "spread" + query_columns = {'quotes': f"close{tail}, model{tail}", + 'adjquotes': f"adjclose{tail}, adjmodel{tail}", + 'basis': f"close{tail} - model{tail}", 'theta': "theta", 'duration': "duration"} labels = {'quotes': ["Date", "Close", "FV"], |
