aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/pnl_explain.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/pnl_explain.py b/python/pnl_explain.py
index fb23b574..5c0c31ab 100644
--- a/python/pnl_explain.py
+++ b/python/pnl_explain.py
@@ -20,7 +20,7 @@ def get_index_pv(
conn: connection,
strategies: Tuple[str] = (),
):
- dr = pd.bdate_range(start_date, next_business_day(end_date), freq=bus_day)
+ dr = pd.bdate_range(start_date, next_business_day(end_date))
if not strategies:
return pd.DataFrame(0.0, index=dr, columns=["pv", "upfront", "accrued"])
pvs = []
@@ -120,13 +120,13 @@ def get_tranche_pv(
conn: connection,
**kwargs,
):
- dr = pd.bdate_range(start_date, next_business_day(end_date), freq=bus_day)
+ dr = pd.bdate_range(start_date, next_business_day(end_date))
pv = []
upfronts = []
accrueds = []
dates = []
- for d in dr:
- prev_day = (d - bus_day).date()
+ for d in dr.date:
+ prev_day = prev_business_day(d)
if previous_twentieth(prev_day, roll=True) == prev_day:
# we know prev_day is an accrued payment date
# we remove one business day so that previous_twentieth actually returns