do not verify ticker_interval and whitelist for list-markets/list-pairs

This commit is contained in:
hroff-1902 2019-07-05 20:32:17 +03:00
parent 72fb80904c
commit cbd488fc7e
2 changed files with 12 additions and 3 deletions

View File

@ -135,12 +135,12 @@ class Exchange(object):
# Check if all pairs are available
self.validate_pairs(config['exchange']['pair_whitelist'])
self.validate_ordertypes(config.get('order_types', {}))
self.validate_order_time_in_force(config.get('order_time_in_force', {}))
if config.get('ticker_interval'):
# Check if timeframe is available
self.validate_timeframes(config['ticker_interval'])
# Check if timeframe is available
self.validate_timeframes(config['ticker_interval'])
def __del__(self):
"""
@ -295,6 +295,9 @@ class Exchange(object):
"""
Checks if ticker interval from config is a supported timeframe on the exchange
"""
if not timeframe:
return
if not hasattr(self._api, "timeframes") or self._api.timeframes is None:
# If timeframes attribute is missing (or is None), the exchange probably
# has no fetchOHLCV method.

View File

@ -57,6 +57,12 @@ def start_list_pairs(args: Namespace, pairs_only: bool = False) -> None:
# Fetch exchange name from args, use bittrex as default exchange
config['exchange']['name'] = args.exchange or 'bittrex'
# We don't need ticker interval and pairs whitelist
# for this subcommand,
# avoid validating it by the Exchange object
config['exchange']['pairs_whitelist'] = None
config['ticker_interval'] = None
# Init exchange
exchange = Exchange(config)