aboutsummaryrefslogtreecommitdiffstats
path: root/python/collateral
diff options
context:
space:
mode:
Diffstat (limited to 'python/collateral')
-rw-r--r--python/collateral/baml_isda.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/collateral/baml_isda.py b/python/collateral/baml_isda.py
index 61740b83..b023fd66 100644
--- a/python/collateral/baml_isda.py
+++ b/python/collateral/baml_isda.py
@@ -1,4 +1,5 @@
from . import DAILY_DIR
+from analytics.utils import get_fx
from bs4 import BeautifulSoup
from io import BytesIO
from pandas.tseries.offsets import BDay
@@ -133,6 +134,9 @@ def load_excel(fname):
rows.append(r)
i += 1
df = pd.DataFrame.from_records(rows, columns=headers)
+ if not df.empty:
+ df["fx"] = df[["Market Value Date", "Ccy1"]].apply(lambda x: get_fx(*x), axis=1)
+ df["Market Value Amount"] /= df["fx"]
df = df.rename(
columns={
"Contract ID ": "Trade ID",