Merge pull request #4282 from pan-long/patch-1

Fix a bug when compare sell_profit_offset
This commit is contained in:
Matthias
2021-02-02 08:22:38 +01:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -530,8 +530,8 @@ class IStrategy(ABC):
current_time=date))
if (ask_strategy.get('sell_profit_only', False)
and trade.calc_profit(rate=rate) <= ask_strategy.get('sell_profit_offset', 0)):
# Negative profits and sell_profit_only - ignore sell signal
and current_profit <= ask_strategy.get('sell_profit_offset', 0)):
# sell_profit_only and profit doesn't reach the offset - ignore sell signal
sell_signal = False
else:
sell_signal = sell and not buy and ask_strategy.get('use_sell_signal', True)