diff options
| -rw-r--r-- | python/cds_curve.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/python/cds_curve.py b/python/cds_curve.py index 02e8639e..6e4106df 100644 --- a/python/cds_curve.py +++ b/python/cds_curve.py @@ -1,11 +1,15 @@ from analytics.basket_index import MarkitBasketIndex +from analytics.exceptions import MissingDataError from pyisda.legs import FeeLeg, ContingentLeg from pyisda.logging import enable_logging +import logging import pandas as pd from utils.db import dbconn +logger = logging.getLogger(__name__) + def all_curves_pv( curves, today_date, jp_yc, start_date, step_in_date, value_date, maturities @@ -42,7 +46,11 @@ def calibrate_portfolio( if start_date: index.index_quotes = index.index_quotes[start_date:] for value_date, v in index.index_quotes.groupby("date")["id"]: - index.value_date = value_date + try: + index.value_date = value_date + except MissingDataError as e: + print(e) + continue index.tweak() df = pd.concat( [ |
