Move ExitCheckTuple to enums

This commit is contained in:
Matthias
2022-03-25 06:50:18 +01:00
parent 8d111d357a
commit c07883b1f9
8 changed files with 30 additions and 28 deletions

View File

@@ -1,6 +1,7 @@
# flake8: noqa: F401
from freqtrade.enums.backteststate import BacktestState
from freqtrade.enums.candletype import CandleType
from freqtrade.enums.exitchecktuple import ExitCheckTuple
from freqtrade.enums.marginmode import MarginMode
from freqtrade.enums.ordertypevalue import OrderTypeValues
from freqtrade.enums.rpcmessagetype import RPCMessageType

View File

@@ -0,0 +1,17 @@
from freqtrade.enums.selltype import SellType
class ExitCheckTuple:
"""
NamedTuple for Exit type + reason
"""
exit_type: SellType
exit_reason: str = ''
def __init__(self, exit_type: SellType, exit_reason: str = ''):
self.exit_type = exit_type
self.exit_reason = exit_reason or exit_type.value
@property
def exit_flag(self):
return self.exit_type != SellType.NONE