aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/collateral/__main__.py6
-rw-r--r--python/collateral/baml_isda.py2
2 files changed, 6 insertions, 2 deletions
diff --git a/python/collateral/__main__.py b/python/collateral/__main__.py
index 31c22975..e2958d27 100644
--- a/python/collateral/__main__.py
+++ b/python/collateral/__main__.py
@@ -31,7 +31,7 @@ parser.add_argument(
"-s", "--send-email", action="store_true", help="send email to Globeop"
)
args = parser.parse_args()
-counterparties = ["citi", "ms", "gs", "bnp", "baml_fcm", "baml_isda", "wells"]
+counterparties = ["citi", "baml_isda", "ms", "gs", "bnp", "baml_fcm", "wells"]
if args.download:
for cp in counterparties:
cp_mod = import_module(f".{cp}", "collateral")
@@ -63,7 +63,9 @@ for cp in counterparties:
)
except ValueError as e:
logger.error(e)
- if cp == "citi": # all cp except CITI operate on previous business day
+ if (
+ cp == "baml_isda"
+ ): # all cp except CITI and BAML operate on previous business day
args.workdate = args.workdate - BDay()
df = pd.concat(df, names=["broker", "strategy"]).reset_index()
diff --git a/python/collateral/baml_isda.py b/python/collateral/baml_isda.py
index aaf5768c..b53cdaa6 100644
--- a/python/collateral/baml_isda.py
+++ b/python/collateral/baml_isda.py
@@ -1,6 +1,7 @@
from . import DAILY_DIR
from bs4 import BeautifulSoup
from io import BytesIO
+from pandas.tseries.offsets import BDay
import logging
import pandas as pd
import pathlib
@@ -113,6 +114,7 @@ def collateral(d, dawn_trades, *args):
df = pd.read_excel(fname, skiprows=6, skipfooter=6)
df = df.drop(0, axis=0)
collateral = float(df.Notional)
+ d -= BDay()
fname = REPORTS_DIR / f"Interest Rates Trade Summary_{d:%d-%b-%Y}.xls"
# TODO: make more robust
df = baml_load_excel(fname)