diff options
Diffstat (limited to 'python/quote_parsing/parse_emails.py')
| -rw-r--r-- | python/quote_parsing/parse_emails.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/python/quote_parsing/parse_emails.py b/python/quote_parsing/parse_emails.py index 5b54b560..d5538204 100644 --- a/python/quote_parsing/parse_emails.py +++ b/python/quote_parsing/parse_emails.py @@ -680,6 +680,56 @@ def parse_jpm(fh, index_desc): return option_stack, fwd_index +def parse_gs_block_eu(fh, indextype): + indextype = "XO" + r = [] + for line in fh: + line = line.strip() + if line == "" or "|" in line: + break + if "%" in line: + line = line.replace("/", " ") + ( + strike, + pay_bid, + pay_offer, + delta, + rec_bid, + rec_offer, + vol, + _, + _, + ) = line.split() + r.append( + [ + strike, + rec_bid, + rec_offer, + delta, + pay_bid, + pay_offer, + delta, + vol, + ] + ) + return makedf(r, indextype, "GS") + + +def parse_gs_eu(fh, index_desc): + option_stack = {} + fwd_index = [] + + pat = re.compile(r"(\w{3}\d{2})") + line = next(fh).strip() + while True: + if ("|" in line) and ("STK" not in line): + line = next(fh).strip() + if m := pat.match(line): + expiry = m.groups() + expiry = pd.to_datetime(expiry, format="%b%y") + parse_gs_block_eu + + # subject_baml = re.compile(r"(?:Fwd:){0,2}(?:BAML )?(\D{2})(\d{1,2})\s") regex_dict = { |
