handle empty markets from ccxt
This commit is contained in:
parent
d2f0bf6ef6
commit
be70c4f959
@ -208,6 +208,7 @@ class Exchange(object):
|
||||
if this was requested in parameters.
|
||||
"""
|
||||
markets = self.markets
|
||||
if markets is not None:
|
||||
if base_currency:
|
||||
markets = {k: v for k, v in markets.items() if v['base'] == base_currency}
|
||||
if quote_currency:
|
||||
@ -216,6 +217,7 @@ class Exchange(object):
|
||||
markets = {k: v for k, v in markets.items() if symbol_is_pair(v['symbol'])}
|
||||
if active_only:
|
||||
markets = {k: v for k, v in markets.items() if v['active']}
|
||||
|
||||
return markets
|
||||
|
||||
def klines(self, pair_interval: Tuple[str, str], copy=True) -> DataFrame:
|
||||
|
@ -2,6 +2,7 @@ import logging
|
||||
from argparse import Namespace
|
||||
from typing import Any, Dict
|
||||
|
||||
from freqtrade import OperationalException
|
||||
from freqtrade.configuration import Configuration
|
||||
from freqtrade.exchange import available_exchanges, Exchange
|
||||
from freqtrade.misc import plural
|
||||
@ -67,6 +68,9 @@ def start_list_pairs(args: Namespace, pairs_only: bool = False) -> None:
|
||||
pairs_only=pairs_only,
|
||||
active_only=args.active_only)
|
||||
|
||||
if pairs is None:
|
||||
raise OperationalException(f"No markets info available for exchange \"{exchange.name}\"")
|
||||
|
||||
if args.print_list:
|
||||
# print data as a list
|
||||
print(f"Exchange {exchange.name} has {len(pairs)} " +
|
||||
|
Loading…
Reference in New Issue
Block a user