diff options
Diffstat (limited to 'python/position.py')
| -rw-r--r-- | python/position.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/python/position.py b/python/position.py index 83bff28f..3f40db1d 100644 --- a/python/position.py +++ b/python/position.py @@ -224,13 +224,23 @@ def update_swaption_vol( """ Parameters ---------- - vol_type : one of 'N' or 'V' (normal or log-normal) + vol_type : one of 'N', 'V' or 'N_OIS' (normal or log-normal) """ - db_vol_type = "Normal" if vol_type == "N" else "LogNormal" + match vol_type: + case "N": + db_vol_type = "Normal" + ticker_pattern = "USSV{:0>2}{} {} Curncy" + case "V": + db_vol_type = "LogNormal" + ticker_pattern = "USSV{:0>2}{} {} Curncy" + case "N_OIS": + db_vol_type = "Normal (OIS)" + ticker_pattern = "USSNA{}{} {} Curncy" + mappings = {"A": "1M", "C": "3M", "F": "6M", "I": "9M"} for source in sources: tickers = { - f"USS{vol_type}{e:0>2}{t} {source} Curncy": (e, t) + ticker_pattern.format(e, t, source): (e, t) for e, t in product(expiries, tenors) } data = retrieve_data(session, tickers, ["PX_LAST"], start_date=start_from) @@ -388,7 +398,7 @@ if __name__ == "__main__": update_fx(dawn_conn, session, ["EURUSD", "CADUSD"]) update_swap_rates(serenitas_conn, session) update_cash_rates(serenitas_conn, session) - for vol_type in ["N", "V"]: + for vol_type in ["N", "V", "N_OIS"]: update_swaption_vol(serenitas_conn, session, vol_type=vol_type) bbg_call(dawn_engine, dawn_conn, serenitas_conn, args.workdate) |
