aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops
diff options
context:
space:
mode:
Diffstat (limited to 'python/report_ops')
-rw-r--r--python/report_ops/utils.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py
index d7f6cbb5..6eafcc36 100644
--- a/python/report_ops/utils.py
+++ b/python/report_ops/utils.py
@@ -370,6 +370,35 @@ class FxHedge(
)
+class MarginEstimatesMonitor(
+ Monitor,
+ headers=("date", "counterparty", "excess", "currency"),
+ num_format=[("{0:,.2f}", 2)],
+):
+ @classmethod
+ def email(cls, date):
+ if not cls._staging_queue:
+ return
+ cls._em.send_email(
+ f"Margin Estimates: {date}",
+ HTMLBody(
+ f"""
+<html>
+ <head>
+ <style>
+ table, th, td {{ border: 1px solid black; border-collapse: collapse;}}
+ th, td {{ padding: 5px; }}
+ </style>
+ </head>
+ <body>
+ Margin Estimates Receive/(Pay):<br><br>{cls.to_tabulate()}
+ </body>
+</html>"""
+ ),
+ to_recipients=_cc_recipients["SERCGMAST"],
+ )
+
+
class QuantifiMonitor(
Monitor,
headers=(