Updating condition to use sell_profit_offset without setting sell_profit_only to True

This commit is contained in:
zx 2021-08-10 02:53:06 +03:00
parent cf27968b97
commit b40bd74c63

View File

@ -589,7 +589,8 @@ class IStrategy(ABC, HyperStrategyMixin):
current_rate = rate current_rate = rate
current_profit = trade.calc_profit_ratio(current_rate) current_profit = trade.calc_profit_ratio(current_rate)
if (self.sell_profit_only and current_profit <= self.sell_profit_offset): if ((self.sell_profit_only and current_profit <= self.sell_profit_offset)
or (current_profit >= 0 and current_profit <= self.sell_profit_offset)):
# sell_profit_only and profit doesn't reach the offset - ignore sell signal # sell_profit_only and profit doesn't reach the offset - ignore sell signal
pass pass
elif self.use_sell_signal and not buy: elif self.use_sell_signal and not buy: