diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/risk/tranches.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py index 98d31357..f468108f 100644 --- a/python/risk/tranches.py +++ b/python/risk/tranches.py @@ -48,6 +48,10 @@ def insert_tranche_portfolio(portf, conn): with conn.cursor() as c: for (strat, trade_id), trade in portf.items(): print(strat, trade_id) + try: + theta = trade.theta(method="TLP") + except ValueError: + theta = None c.execute(sql_str, (trade.value_date, trade_id, trade.clean_pv, @@ -55,7 +59,7 @@ def insert_tranche_portfolio(portf, conn): trade.duration, trade.delta, trade.gamma, - trade.theta(method="TLP"), + theta, trade.upfront, trade.tranche_running, trade.rho[0], |
