check if ticker sort key is populated

This commit is contained in:
iuvbio 2019-03-14 22:48:42 +01:00
parent 3fe06b3548
commit 95a3b5c41e
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ class VolumePairList(IPairList):
tickers = self._freqtrade.exchange.get_tickers()
# check length so that we make sure that '/' is actually in the string
tickers = [v for k, v in tickers.items()
if len(k.split('/')) == 2 and k.split('/')[1] == base_currency]
if (len(k.split('/')) == 2 and k.split('/')[1] == base_currency
and v[key] is not None)]
sorted_tickers = sorted(tickers, reverse=True, key=lambda t: t[key])
# Validate whitelist to only have active market pairs
valid_pairs = self._validate_whitelist([s['symbol'] for s in sorted_tickers])