Skip to content

Commit

Permalink
get bool
Browse files Browse the repository at this point in the history
  • Loading branch information
AdoNunes committed Apr 12, 2024
1 parent 0b009ed commit 4fbc113
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tradealerter/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,20 @@ def gui():

try:
new_order, date, port_ix = orders_queue.get(False)
if port_ix is None:
if port_ix is None and not cfg['alert_configs'].getboolean('send_all_BTOs'):
print("skipping as not in port", new_order)
continue
trade = ord_checker.port.loc[port_ix]
if new_order.startswith("BTO"):
if cfg['alert_configs']['send_all_BTOs']:
if cfg['alert_configs'].getboolean('send_all_BTOs'):
status = "do_send"
elif (pd.Series(trade['BTOs-sent']) - trade['BTO-n']).lt(0).all():
status = "Send"
else:
status = "Sent"
elif new_order.startswith("STC"):
# send all STC
if cfg['alert_configs']['send_all_BTOs']:
if cfg['alert_configs'].getboolean('send_all_BTOs'):
status = "do_send"
# if not sent but BTO not sent
elif pd.isna(trade['BTOs-sent']):
Expand Down

0 comments on commit 4fbc113

Please sign in to comment.