Skip to content

Commit 693347d

Browse files
committed
add control/BUY flag
1 parent 43e24fc commit 693347d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/bot.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2049,9 +2049,17 @@ def process_control_flags(self) -> None:
20492049
symbol = line.strip()
20502050
if symbol in self.wallet:
20512051
logging.warning(f"control/SELL contains {symbol}")
2052-
self.coins[symbol].status = "CONTROL_FLAG"
20532052
self.sell_coin(self.coins[symbol])
20542053
unlink("control/SELL")
2054+
if exists("control/BUY"):
2055+
logging.warning("control/BUY flag found")
2056+
with open("control/BUY") as f:
2057+
for line in f:
2058+
symbol = line.strip()
2059+
if symbol not in self.wallet:
2060+
logging.warning(f"control/BUY contains {symbol}")
2061+
self.buy_coin(self.coins[symbol])
2062+
unlink("control/BUY")
20552063
if exists("control/STOP"):
20562064
logging.warning("control/STOP flag found. Stopping bot.")
20572065
self.quit = True

0 commit comments

Comments
 (0)