diff options
| -rw-r--r-- | python/risk/tranches.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py index 125dc72b..15cee9b1 100644 --- a/python/risk/tranches.py +++ b/python/risk/tranches.py @@ -3,16 +3,16 @@ import logging logger = logging.getLogger(__name__) -def get_tranche_portfolio(date, conn, by_strat=False): +def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"): if by_strat: - sql_string = "SELECT * from list_tranche_positions_by_strat(%s)" - params = (date,) + sql_string = "SELECT * from list_tranche_positions_by_strat(%s, %s)" + params = (date, fund) else: sql_string = ("SELECT id from cds " "WHERE orig_attach IS NOT NULL " "AND (termination_date IS NULL OR termination_date > %s) " - "AND maturity > %s ORDER BY trade_date") - params = (date, date) + "AND maturity > %s AND fund = %s ORDER BY trade_date") + params = (date, date, fund) with conn.cursor() as c: c.execute(sql_string, params) if by_strat: |
