Add new runmodes

This commit is contained in:
Matthias 2019-11-01 15:39:25 +01:00
parent 880834b902
commit 241d947564
4 changed files with 10 additions and 6 deletions

View File

@ -21,7 +21,8 @@ def check_exchange(config: Dict[str, Any], check_for_bad: bool = True) -> bool:
and thus is not known for the Freqtrade at all. and thus is not known for the Freqtrade at all.
""" """
if config['runmode'] in [RunMode.PLOT] and not config.get('exchange', {}).get('name'): if (config['runmode'] in [RunMode.PLOT, RunMode.UTIL_NO_EXCHANGE]
and not config.get('exchange', {}).get('name')):
# Skip checking exchange in plot mode, since it requires no exchange # Skip checking exchange in plot mode, since it requires no exchange
return True return True
logger.info("Checking exchange...") logger.info("Checking exchange...")

View File

@ -118,7 +118,8 @@ def _validate_whitelist(conf: Dict[str, Any]) -> None:
""" """
Dynamic whitelist does not require pair_whitelist to be set - however StaticWhitelist does. Dynamic whitelist does not require pair_whitelist to be set - however StaticWhitelist does.
""" """
if conf.get('runmode', RunMode.OTHER) in [RunMode.OTHER, RunMode.PLOT]: if conf.get('runmode', RunMode.OTHER) in [RunMode.OTHER, RunMode.PLOT,
RunMode.UTIL_NO_EXCHANGE, RunMode.UTIL_EXCHANGE]:
return return
if (conf.get('pairlist', {}).get('method', 'StaticPairList') == 'StaticPairList' if (conf.get('pairlist', {}).get('method', 'StaticPairList') == 'StaticPairList'

View File

@ -25,5 +25,7 @@ class RunMode(Enum):
BACKTEST = "backtest" BACKTEST = "backtest"
EDGE = "edge" EDGE = "edge"
HYPEROPT = "hyperopt" HYPEROPT = "hyperopt"
UTIL_EXCHANGE = "util_exchange"
UTIL_NO_EXCHANGE = "util_no_exchange"
PLOT = "plot" PLOT = "plot"
OTHER = "other" # Used for plotting scripts and test OTHER = "other"

View File

@ -74,7 +74,7 @@ def start_download_data(args: Dict[str, Any]) -> None:
""" """
Download data (former download_backtest_data.py script) Download data (former download_backtest_data.py script)
""" """
config = setup_utils_configuration(args, RunMode.OTHER) config = setup_utils_configuration(args, RunMode.UTIL_EXCHANGE)
timerange = TimeRange() timerange = TimeRange()
if 'days' in config: if 'days' in config:
@ -123,7 +123,7 @@ def start_list_timeframes(args: Dict[str, Any]) -> None:
""" """
Print ticker intervals (timeframes) available on Exchange Print ticker intervals (timeframes) available on Exchange
""" """
config = setup_utils_configuration(args, RunMode.OTHER) config = setup_utils_configuration(args, RunMode.UTIL_EXCHANGE)
# Do not use ticker_interval set in the config # Do not use ticker_interval set in the config
config['ticker_interval'] = None config['ticker_interval'] = None
@ -144,7 +144,7 @@ def start_list_markets(args: Dict[str, Any], pairs_only: bool = False) -> None:
:param pairs_only: if True print only pairs, otherwise print all instruments (markets) :param pairs_only: if True print only pairs, otherwise print all instruments (markets)
:return: None :return: None
""" """
config = setup_utils_configuration(args, RunMode.OTHER) config = setup_utils_configuration(args, RunMode.UTIL_EXCHANGE)
# Init exchange # Init exchange
exchange = ExchangeResolver(config['exchange']['name'], config, validate=False).exchange exchange = ExchangeResolver(config['exchange']['name'], config, validate=False).exchange