Skip to content

Commit

Permalink
Merge pull request #2 from Murraya-paniculata/release-0.5
Browse files Browse the repository at this point in the history
fix:allowed_lists and blocked_lists cannot be satisfied at the same time
  • Loading branch information
51bitquant authored Sep 12, 2021
2 parents 3bd6e07 + 1b7c717 commit 5f38f86
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions trader/binance_spot_trader.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,17 @@ def start(self):
s = signal['symbol']
if signal['signal'] == 1 and index < left_times and s not in pos_symbols and signal[
'hour_turnover'] >= config.turnover_threshold:
## allowed_lists and blocked_lists cannot be satisfied at the same time
if len(config.allowed_lists) > 0 and s in config.allowed_lists:

index += 1
# 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'])

Expand Down

0 comments on commit 5f38f86

Please sign in to comment.