Skip to content

Commit

Permalink
mm form, dtype obj
Browse files Browse the repository at this point in the history
  • Loading branch information
AdoNunes committed Feb 3, 2024
1 parent 9afad97 commit a645d9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions DiscordAlertsTrader/gui_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ def get_tracker_data(exclude={}, track_filt_author='', track_filt_date_frm='',
cols = ['Live'] + cols

data = data[cols]
data = data.astype(object)
data.fillna("", inplace=True)
header_list = data.columns.tolist()
header_list = [d.replace('STC', 'S') for d in header_list]
Expand Down
7 changes: 6 additions & 1 deletion DiscordAlertsTrader/server_alert_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,13 @@ def moneymotive(message_):
if "%" in alert: # just status update
return message

if ":rotating_light:" in alert and "/" not in alert:
alert = alert.replace(":rotating_light:", "0DTE :rotating_light:")
message.content = alert

if "0DTE" in alert:
alert = format_0dte_weeklies(alert, message, remove_price=False)
message.content = alert

pattern = r'\$?(\w+)\s+([\d.]+)\s+(\w+)\s+(\d{1,2}\/\d{1,2})\s+@\s+([\d.]+)'
match = re.search(pattern, alert, re.IGNORECASE)
Expand All @@ -490,7 +495,7 @@ def moneymotive(message_):
alert = f"BTO {ticker} {strike.upper()}{otype[0]} {expDate} @{price}"
message.content = alert
else:
pattern = r'\$?(\w+)\s+([\d.]+)\s+(\w+)\s+@\s+([\d.]+)\s+(\d{1,2}\/\d{1,2})'
pattern = r'\$?(\w+)\s+([\d.]+)\s+(\w+)\s+@\s+([\d.]+)\s+\w*\s+(\d{1,2}\/\d{1,2})'
match = re.search(pattern, alert, re.IGNORECASE)
if match:
ticker, strike, otype, price, expDate = match.groups()
Expand Down

0 comments on commit a645d9c

Please sign in to comment.