diff options
Diffstat (limited to 'python/pnl_explain.py')
| -rw-r--r-- | python/pnl_explain.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/python/pnl_explain.py b/python/pnl_explain.py index 352e19b6..7137920c 100644 --- a/python/pnl_explain.py +++ b/python/pnl_explain.py @@ -1,6 +1,6 @@ import datetime import pandas as pd -from analytics.utils import get_fx, prev_business_day +from analytics.utils import get_fx, prev_business_day, next_business_day from dates import bus_day from psycopg2.errors import SyntaxError from psycopg2.extensions import connection @@ -115,7 +115,7 @@ def get_tranche_pv( conn: connection, **kwargs, ): - dr = pd.bdate_range(start_date, end_date, freq=bus_day) + dr = pd.bdate_range(start_date, next_business_day(end_date), freq=bus_day) pv = [] upfronts = [] accrueds = [] @@ -171,12 +171,21 @@ def get_tranche_pv( ) if fund == "SERCGMAST": defaults = pd.DataFrame( - {"upfront": [963398.61 * 3, 738908.68 * 3, 990427.08 * 3, 990260.59 * 3]}, + { + "upfront": [ + 963398.61 * 3, + 738908.68 * 3, + 990427.08 * 3, + 990260.59 * 3, + 963927.78 * 3, + ], + }, index=[ pd.Timestamp("2020-06-01"), pd.Timestamp("2020-06-10"), pd.Timestamp("2020-06-25"), pd.Timestamp("2020-07-08"), + pd.Timestamp("2020-08-05"), ], ) return df.sub(defaults.reindex(df.index, fill_value=0.0), fill_value=0.0) |
