aboutsummaryrefslogtreecommitdiffstats
path: root/python/import_cds_quotes.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/import_cds_quotes.py')
-rw-r--r--python/import_cds_quotes.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/import_cds_quotes.py b/python/import_cds_quotes.py
index c53e99b7..058213c9 100644
--- a/python/import_cds_quotes.py
+++ b/python/import_cds_quotes.py
@@ -17,13 +17,18 @@ def get_current_tickers(database, workdate):
sqlstr = "SELECT markit_ticker, markit_tier, cds_curve from index_members(%s, %s)"
markit_bbg_mapping = {}
all_tickers = set([])
+ if workdate >= datetime.date(2014, 9, 19):
+ doc_clause = 'XR14'
+ else:
+ doc_clause = 'XR'
for index in ['HY9', 'HY10', 'HY15', 'HY17', 'HY19', 'HY21', 'IG9', 'IG19', 'IG21']:
spread=0.05 if 'HY' in index else 0.01
with database.cursor() as c:
c.execute(sqlstr, (index, workdate))
for line in c:
all_tickers.add((line['markit_ticker'], line['markit_tier']))
- key = (line['markit_ticker'], line['markit_tier'], 'USD', 'XR14', spread)
+ if workdate <= datetime.date(2014, 9, 19):
+ key = (line['markit_ticker'], line['markit_tier'], 'USD', doc_clause, spread)
hykey = key[:-1]+(0.05,)
if hykey in markit_bbg_mapping:
del markit_bbg_mapping[hykey] ## we only keep the tightest quote