aboutsummaryrefslogtreecommitdiffstats
path: root/python/mark_swaptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/mark_swaptions.py')
-rw-r--r--python/mark_swaptions.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/mark_swaptions.py b/python/mark_swaptions.py
index d9954974..4db50724 100644
--- a/python/mark_swaptions.py
+++ b/python/mark_swaptions.py
@@ -15,8 +15,10 @@ logging.basicConfig(filename=os.path.join(os.getenv("LOG_DIR"),
def get_swaption_portfolio(date, conn):
with conn.cursor() as c:
- c.execute("SELECT id, dealid FROM swaptions WHERE termination_date is NULL "
- "AND expiration_date > %s AND trade_date <= %s", (date, date))
+ c.execute("SELECT id, dealid FROM swaptions "
+ "WHERE (termination_date is NULL or termination_date > %s) "
+ "AND expiration_date > %s AND trade_date <= %s "
+ "AND swap_type='CD_INDEX_OPTION'", (date, date, date))
try:
trade_ids, deal_ids = zip(*c)
except ValueError: