diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/book_bbg.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/python/book_bbg.py b/python/book_bbg.py index 82177e75..3ba4179b 100644 --- a/python/book_bbg.py +++ b/python/book_bbg.py @@ -77,7 +77,7 @@ class Bbg: @staticmethod def get_bbg_id(s): - if m := re.match("(CDX|BOND)(?:BLOCK)?-[^_]*_([^$]*)", s): + if m := re.match("(CDX|BOND|IRS)(?:BLOCK)?-[^_]*_([^$]*)", s): return m.groups() if "DEAL" in s: return "FX", s.split("_")[3] @@ -112,6 +112,14 @@ class BondTicket(Bbg, ticket_type="BOND"): return BondDeal if row["Side"] in ("B", "S") else IRSDeal +class IRSTicket(Bbg, ticket_type="IRS"): + _sql_insert = f"INSERT INTO irs_tickets VALUES({','.join(['%s'] * 24)})" + + @staticmethod + def trade_class(row): + return IRSDeal + + class CDSTicket(Bbg, ticket_type="CDX"): _sql_insert = f"INSERT INTO cds_tickets VALUES({','.join(['%s'] * 22)})" |
