aboutsummaryrefslogtreecommitdiffstats
path: root/python/pnl_explain.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/pnl_explain.py')
-rw-r--r--python/pnl_explain.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/pnl_explain.py b/python/pnl_explain.py
index 914c84ed..ee9ba1a7 100644
--- a/python/pnl_explain.py
+++ b/python/pnl_explain.py
@@ -403,7 +403,9 @@ def get_bond_pv(
def get_pnl(
- df_instrument, asset_class: Literal["bond", "tranche", "swaption"], pv2=False
+ df_instrument,
+ asset_class: Literal["bond", "tranche", "swaption", "fx_forward"],
+ pv2=False,
):
if asset_class == "bond":
return df_instrument.drop("notional", axis=1).groupby("date").sum().sum(axis=1)
@@ -426,6 +428,8 @@ def get_pnl(
)
elif asset_class == "swaption":
return df_instrument.pv.diff() + df_instrument.daily
+ elif asset_class == "fx_forward":
+ return df_instrument.pv.diff() + df_instrument.net_settle
def cumulative_from_daily(df):