aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/pnl_explain.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/python/pnl_explain.py b/python/pnl_explain.py
index fa2fe22c..fe75f429 100644
--- a/python/pnl_explain.py
+++ b/python/pnl_explain.py
@@ -364,8 +364,8 @@ if __name__ == "__main__":
action="store",
default="tranche",
dest="pnl_type",
- choices=("tranche", "swaption", "bond", "hedge"),
- help="instrument for which we want the pnl ('tranche', 'swaption', 'bond', 'hedge')",
+ choices=("tranche", "swaption", "bond", "hedge", "curve"),
+ help="instrument for which we want the pnl ('tranche', 'swaption', 'bond', 'hedge', 'curve')",
)
parser.add_argument(
"-f",
@@ -388,13 +388,14 @@ if __name__ == "__main__":
"swaption": ("IGOPTDEL", "HYOPTDEL"),
"hedge": ("HEDGE_MBS", "HEDGE_CLO", "HEDGE_MAC"),
"tranche": ("IGINX", "HYINX", "XOINX"),
+ "curve": ("SER_ITRXCURVE", "SER_IGCURVE"),
"bond": None,
}
df_index = get_index_pv(
args.start_date, args.end_date, args.fund, dawndb, strats[args.pnl_type]
)
pnl_index = df_index.pv.diff() + df_index[["upfront", "accrued"]].sum(axis=1)
- if args.pnl_type != "hedge":
+ if args.pnl_type not in ["hedge", "curve"]:
df_instrument = get_pv(conn=dawndb, **vars(args))
pnl_instrument = get_pnl(df_instrument, args.pnl_type)
pnl = pd.concat(
@@ -402,7 +403,8 @@ if __name__ == "__main__":
)
print(cumulative_from_daily(pnl.sum(axis=1)))
- elif args.pnl_type == "hedge":
+ elif args.pnl_type in ["hedge", "curve"]:
print(cumulative_from_daily(pnl_index))
# HTZ: -738908.68 * 3
# JCP 963398.61 * 3
+ # CRC: 990260.59 * 3