stable/freqtrade/enums/exitchecktuple.py

18 lines
423 B
Python
Raw Normal View History

2022-03-25 05:55:37 +00:00
from freqtrade.enums.exittype import ExitType
2022-03-25 05:50:18 +00:00
class ExitCheckTuple:
"""
NamedTuple for Exit type + reason
"""
2022-03-25 05:55:37 +00:00
exit_type: ExitType
2022-03-25 05:50:18 +00:00
exit_reason: str = ''
2022-03-25 05:55:37 +00:00
def __init__(self, exit_type: ExitType, exit_reason: str = ''):
2022-03-25 05:50:18 +00:00
self.exit_type = exit_type
self.exit_reason = exit_reason or exit_type.value
@property
def exit_flag(self):
2022-03-25 05:55:37 +00:00
return self.exit_type != ExitType.NONE