aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/collateral/ms.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/python/collateral/ms.py b/python/collateral/ms.py
index 1c4c11eb..1b9b1a6c 100644
--- a/python/collateral/ms.py
+++ b/python/collateral/ms.py
@@ -48,9 +48,12 @@ def download_files(em, count=20, *, fund="Serenitas", **kwargs):
p.write_bytes(attach.content)
-def get_total_collateral(date, fund):
+def get_total_collateral(date, fund, imr_collateral):
df = pd.read_excel(
- DAILY_DIR / fund / "MS_reports" / f"Collateral_Detail_{date:%Y%m%d}.xls"
+ DAILY_DIR
+ / fund
+ / "MS_reports"
+ / f"Collateral_Detail_{'IMR_' if imr_collateral else ''}{date:%Y%m%d}.xls"
)
collat = df.loc[1, "coll_val_ccy"].replace(",", "")
if "(" in collat:
@@ -62,7 +65,13 @@ def get_total_collateral(date, fund):
def collateral(d, dawn_trades, *, fund="Serenitas", **kwargs):
- collat = get_total_collateral(d, fund)
+ match fund:
+ case "BowdSt":
+ collat = get_total_collateral(d, fund, False) + get_total_collateral(
+ d, fund, True
+ )
+ case _:
+ collat = get_total_collateral(d, fund, False)
df = pd.read_excel(DAILY_DIR / fund / "MS_reports" / f"Trade_Detail_{d:%Y%m%d}.xls")
try:
df_fx = pd.read_excel(