setup_configuration() cleanup

This commit is contained in:
hroff-1902 2019-06-16 21:37:43 +03:00
parent 2369161bb0
commit 813c008af2
2 changed files with 6 additions and 9 deletions

View File

@ -5,8 +5,9 @@ from typing import Any, Dict
from filelock import FileLock, Timeout
from freqtrade import DependencyException, constants
from freqtrade.configuration import Configuration
from freqtrade.state import RunMode
from freqtrade.utils import setup_utils_configuration
logger = logging.getLogger(__name__)
@ -17,12 +18,7 @@ def setup_configuration(args: Namespace, method: RunMode) -> Dict[str, Any]:
:param args: Cli args from Arguments()
:return: Configuration
"""
configuration = Configuration(args, method)
config = configuration.load_config()
# Ensure we do not use Exchange credentials
config['exchange']['key'] = ''
config['exchange']['secret'] = ''
config = setup_utils_configuration(args, method)
if method == RunMode.BACKTEST:
if config['stake_amount'] == constants.UNLIMITED_STAKE_AMOUNT:

View File

@ -10,15 +10,16 @@ from freqtrade.state import RunMode
logger = logging.getLogger(__name__)
def setup_configuration(args: Namespace, method: RunMode) -> Dict[str, Any]:
def setup_utils_configuration(args: Namespace, method: RunMode) -> Dict[str, Any]:
"""
Prepare the configuration for the Hyperopt module
Prepare the configuration for utils subcommands
:param args: Cli args from Arguments()
:return: Configuration
"""
configuration = Configuration(args, method)
config = configuration.load_config()
config['exchange']['dry_run'] = True
# Ensure we do not use Exchange credentials
config['exchange']['key'] = ''
config['exchange']['secret'] = ''