freqtrade_origin/freqtrade/commands/utils.py

25 lines
712 B
Python
Raw 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
2020-01-26 12:17:26 +00:00
from freqtrade.configuration import (Configuration, remove_credentials,
2020-01-02 09:41:10 +00:00
validate_config_consistency)
2019-06-12 09:33:20 +00:00
from freqtrade.state import RunMode
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()
:return: Configuration
"""
configuration = Configuration(args, method)
config = configuration.get_config()
2019-06-12 09:33:20 +00:00
# Ensure we do not use Exchange credentials
remove_credentials(config)
2020-01-02 09:41:10 +00:00
validate_config_consistency(config)
2019-06-12 09:33:20 +00:00
return config