This commit is contained in:
Matthias
2018-10-29 19:23:56 +01:00
parent 1121ec0724
commit 2f55cbde35
2 changed files with 54 additions and 3 deletions

View File

@@ -179,12 +179,17 @@ class FreqtradeBot(object):
# Keep only the subsets of pairs wanted (up to nb_assets)
self.active_pair_whitelist = sanitized_list[:nb_assets] if nb_assets else sanitized_list
# Refreshing candles
self.exchange.refresh_tickers(self.active_pair_whitelist, self.strategy.ticker_interval)
# Query trades from persistence layer
trades = Trade.query.filter(Trade.is_open.is_(True)).all()
# Extend active-pair whitelist with pairs from open trades
# ensures that tickers are downloaded for open trades
self.active_pair_whitelist.extend([trade.pair for trade in trades
if trade.pair not in self.active_pair_whitelist])
# Refreshing candles
self.exchange.refresh_tickers(self.active_pair_whitelist, self.strategy.ticker_interval)
# First process current opened trades
for trade in trades:
state_changed |= self.process_maybe_execute_sell(trade)