From fc3c717a6be2d42ba012e09584f5d6e7fdc3a647 Mon Sep 17 00:00:00 2001 From: 51bitquant Date: Sun, 12 Sep 2021 10:03:35 +0800 Subject: [PATCH] fix the allowed_lists and blocked_lists error --- main.py | 2 +- trader/binance_future_trader.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 6fa55f4..de9438e 100644 --- a/main.py +++ b/main.py @@ -93,7 +93,7 @@ def get_data(trader: Union[BinanceFutureTrader, BinanceSpotTrader]): config.loads('./config.json') print(config.blocked_lists) - if config.platform == 'binance_spot': + if config.platform == 'binance_spot': # binance_spot trader = BinanceSpotTrader() else: trader = BinanceFutureTrader() diff --git a/trader/binance_future_trader.py b/trader/binance_future_trader.py index 7bc31a0..6501d96 100644 --- a/trader/binance_future_trader.py +++ b/trader/binance_future_trader.py @@ -314,7 +314,11 @@ def start(self): # the last one hour's the symbol jump over some percent. self.place_order(s, signal['pct'], signal['pct_4h']) - elif s not in config.blocked_lists: + if s not in config.blocked_lists and len(config.allowed_lists) == 0: + index += 1 + self.place_order(s, signal['pct'], signal['pct_4h']) + + if len(config.allowed_lists) == 0 and config.blocked_lists == 0: index += 1 self.place_order(s, signal['pct'], signal['pct_4h'])