diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 77d45b445..da4ce6c50 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -530,7 +530,7 @@ class IStrategy(ABC): current_time=date)) if (ask_strategy.get('sell_profit_only', False) - and trade.calc_profit_ratio(rate=rate) <= ask_strategy.get('sell_profit_offset', 0)): + 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: diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 2408afc87..e2b70257a 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -3159,9 +3159,9 @@ def test_sell_profit_only_enable_profit(default_conf, limit_buy_order, limit_buy mocker.patch.multiple( 'freqtrade.exchange.Exchange', fetch_ticker=MagicMock(return_value={ - 'bid': 0.00002172, - 'ask': 0.00002173, - 'last': 0.00002172 + 'bid': 0.00001172, + 'ask': 0.00001173, + 'last': 0.00001172 }), buy=MagicMock(return_value=limit_buy_order_open), get_fee=fee,