diff options
| -rw-r--r-- | python/risk/tranches.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py index 30d7f66f..55f4ce4d 100644 --- a/python/risk/tranches.py +++ b/python/risk/tranches.py @@ -80,10 +80,11 @@ def insert_tranche_portfolio(portf, conn): try: theta = trade.theta(method="TLP") except (ValueError, RuntimeError) as e: + # when there is less than one year left we computed the theta to maturity logger.info(str(e)) theta = ( - trade.clean_pv / trade.notional / trade.duration - + trade.tranche_running * 1e-4 + trade.clean_pv / trade.notional + + trade.tranche_running * 1e-4 * trade.duration ) c.execute( sql_str, |
