freqtrade_origin/freqtrade/configuration/config_setup.py

28 lines
723 B
Python
Raw Permalink Normal View History

2019-06-12 09:33:20 +00:00
import logging
2020-01-26 12:17:26 +00:00
from typing import Any, Dict
2019-06-12 09:33:20 +00:00
2021-06-08 19:20:35 +00:00
from freqtrade.enums import RunMode
2020-09-28 17:39:41 +00:00
from .config_validation import validate_config_consistency
from .configuration import Configuration
2020-09-28 17:39:41 +00:00
2019-06-12 09:33:20 +00:00
logger = logging.getLogger(__name__)
def setup_utils_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str, Any]:
2019-06-12 09:33:20 +00:00
"""
2019-06-16 18:37:43 +00:00
Prepare the configuration for utils subcommands
2019-06-12 09:33:20 +00:00
:param args: Cli args from Arguments()
2021-06-25 17:13:31 +00:00
:param method: Bot running mode
2019-06-12 09:33:20 +00:00
:return: Configuration
"""
configuration = Configuration(args, method)
config = configuration.get_config()
2019-06-12 09:33:20 +00:00
# Ensure these modes are using Dry-run
config['dry_run'] = True
validate_config_consistency(config, preliminary=True)
2019-06-12 09:33:20 +00:00
return config