Move state enums to enums package

This commit is contained in:
Matthias
2021-06-08 21:20:35 +02:00
parent 3c149b9b59
commit 9c34304cb9
35 changed files with 52 additions and 52 deletions

View File

@@ -1,3 +1,5 @@
# flake8: noqa: F401
from freqtrade.enums.runmode import NON_UTIL_MODES, OPTIMIZE_MODES, TRADING_MODES, RunMode
from freqtrade.enums.selltype import SellType
from freqtrade.enums.signaltype import SignalType
from freqtrade.enums.state import State

View File

@@ -0,0 +1,27 @@
# pragma pylint: disable=too-few-public-methods
"""
Bot state constant
"""
from enum import Enum
class RunMode(Enum):
"""
Bot running mode (backtest, hyperopt, ...)
can be "live", "dry-run", "backtest", "edge", "hyperopt".
"""
LIVE = "live"
DRY_RUN = "dry_run"
BACKTEST = "backtest"
EDGE = "edge"
HYPEROPT = "hyperopt"
UTIL_EXCHANGE = "util_exchange"
UTIL_NO_EXCHANGE = "util_no_exchange"
PLOT = "plot"
OTHER = "other"
TRADING_MODES = [RunMode.LIVE, RunMode.DRY_RUN]
OPTIMIZE_MODES = [RunMode.BACKTEST, RunMode.EDGE, RunMode.HYPEROPT]
NON_UTIL_MODES = TRADING_MODES + OPTIMIZE_MODES

18
freqtrade/enums/state.py Normal file
View File

@@ -0,0 +1,18 @@
# pragma pylint: disable=too-few-public-methods
"""
Bot state constant
"""
from enum import Enum
class State(Enum):
"""
Bot application states
"""
RUNNING = 1
STOPPED = 2
RELOAD_CONFIG = 3
def __str__(self):
return f"{self.name.lower()}"