From 8c12a1fd8bcb302ad8129b2f7e5925c5b2ba7523 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 6 Apr 2024 16:45:06 +0200 Subject: [PATCH] Rename TRADING_MODES constant to avoid naming collision --- freqtrade/configuration/configuration.py | 4 ++-- freqtrade/enums/__init__.py | 2 +- freqtrade/enums/runmode.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/freqtrade/configuration/configuration.py b/freqtrade/configuration/configuration.py index 0da307175..4d945c23e 100644 --- a/freqtrade/configuration/configuration.py +++ b/freqtrade/configuration/configuration.py @@ -13,7 +13,7 @@ from freqtrade.configuration.directory_operations import create_datadir, create_ from freqtrade.configuration.environment_vars import enironment_vars_to_dict from freqtrade.configuration.load_config import load_file, load_from_files from freqtrade.constants import Config -from freqtrade.enums import NON_UTIL_MODES, TRADING_MODES, CandleType, RunMode, TradingMode +from freqtrade.enums import NON_UTIL_MODES, TRADE_MODES, CandleType, RunMode, TradingMode from freqtrade.exceptions import OperationalException from freqtrade.loggers import setup_logging from freqtrade.misc import deep_merge_dicts, parse_db_uri_for_logging @@ -127,7 +127,7 @@ class Configuration: setup_logging(config) def _process_trading_options(self, config: Config) -> None: - if config['runmode'] not in TRADING_MODES: + if config['runmode'] not in TRADE_MODES: return if config.get('dry_run', False): diff --git a/freqtrade/enums/__init__.py b/freqtrade/enums/__init__.py index 69ef345e8..55ab130ae 100644 --- a/freqtrade/enums/__init__.py +++ b/freqtrade/enums/__init__.py @@ -9,7 +9,7 @@ from freqtrade.enums.marketstatetype import MarketDirection from freqtrade.enums.ordertypevalue import OrderTypeValues from freqtrade.enums.pricetype import PriceType from freqtrade.enums.rpcmessagetype import NO_ECHO_MESSAGES, RPCMessageType, RPCRequestType -from freqtrade.enums.runmode import NON_UTIL_MODES, OPTIMIZE_MODES, TRADING_MODES, RunMode +from freqtrade.enums.runmode import NON_UTIL_MODES, OPTIMIZE_MODES, TRADE_MODES, RunMode from freqtrade.enums.signaltype import SignalDirection, SignalTagType, SignalType from freqtrade.enums.state import State from freqtrade.enums.tradingmode import TradingMode diff --git a/freqtrade/enums/runmode.py b/freqtrade/enums/runmode.py index 6545aaec7..17caea466 100644 --- a/freqtrade/enums/runmode.py +++ b/freqtrade/enums/runmode.py @@ -18,6 +18,6 @@ class RunMode(Enum): OTHER = "other" -TRADING_MODES = [RunMode.LIVE, RunMode.DRY_RUN] +TRADE_MODES = [RunMode.LIVE, RunMode.DRY_RUN] OPTIMIZE_MODES = [RunMode.BACKTEST, RunMode.EDGE, RunMode.HYPEROPT] -NON_UTIL_MODES = TRADING_MODES + OPTIMIZE_MODES +NON_UTIL_MODES = TRADE_MODES + OPTIMIZE_MODES