Fix a bug when compare sell_profit_offset
It should be comparing the ratio instead of absolut profit. Also updated the comment.
This commit is contained in:
parent
16dad8b6d4
commit
4cc93151c5
@ -530,8 +530,8 @@ class IStrategy(ABC):
|
|||||||
current_time=date))
|
current_time=date))
|
||||||
|
|
||||||
if (ask_strategy.get('sell_profit_only', False)
|
if (ask_strategy.get('sell_profit_only', False)
|
||||||
and trade.calc_profit(rate=rate) <= ask_strategy.get('sell_profit_offset', 0)):
|
and trade.calc_profit_ratio(rate=rate) <= ask_strategy.get('sell_profit_offset', 0)):
|
||||||
# Negative profits and sell_profit_only - ignore sell signal
|
# sell_profit_only and profit doesn't reach the offset - ignore sell signal
|
||||||
sell_signal = False
|
sell_signal = False
|
||||||
else:
|
else:
|
||||||
sell_signal = sell and not buy and ask_strategy.get('use_sell_signal', True)
|
sell_signal = sell and not buy and ask_strategy.get('use_sell_signal', True)
|
||||||
|
Loading…
Reference in New Issue
Block a user