Simplify should_exit interface

This commit is contained in:
Matthias
2021-08-24 20:47:54 +02:00
parent f3b6a0a797
commit 6524edbb4e
3 changed files with 5 additions and 8 deletions

View File

@@ -666,8 +666,7 @@ class IStrategy(ABC, HyperStrategyMixin):
return False
def should_exit(self, trade: Trade, rate: float, date: datetime, *,
enter_long: bool, enter_short: bool,
exit_long: bool, exit_short: bool,
enter: bool, exit_: bool,
low: float = None, high: float = None,
force_stoploss: float = 0) -> SellCheckTuple:
"""
@@ -679,9 +678,6 @@ class IStrategy(ABC, HyperStrategyMixin):
:return: True if trade should be exited, False otherwise
"""
enter = enter_short if trade.is_short else enter_long
exit_ = exit_short if trade.is_short else exit_long
current_rate = rate
current_profit = trade.calc_profit_ratio(current_rate)