Rename TRADING_MODES constant to avoid naming collision

This commit is contained in:
Matthias 2024-04-06 16:45:06 +02:00
parent a584854d46
commit 8c12a1fd8b
3 changed files with 5 additions and 5 deletions

View File

@ -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):

View File

@ -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

View File

@ -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