From b062b836cc6e5c12e3eebf964d191fe70e1d04ae Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 11 Jan 2021 19:42:44 +0100 Subject: [PATCH] Add test for sell_profit_offset --- tests/test_freqtradebot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 5c5666788..e6aff3352 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -3065,6 +3065,7 @@ def test_sell_profit_only_enable_profit(default_conf, limit_buy_order, limit_buy default_conf['ask_strategy'] = { 'use_sell_signal': True, 'sell_profit_only': True, + 'sell_profit_offset': 0.1, } freqtrade = FreqtradeBot(default_conf) patch_get_signal(freqtrade) @@ -3076,7 +3077,11 @@ def test_sell_profit_only_enable_profit(default_conf, limit_buy_order, limit_buy trade.update(limit_buy_order) freqtrade.wallets.update() patch_get_signal(freqtrade, value=(False, True)) + assert freqtrade.handle_trade(trade) is False + + freqtrade.config['ask_strategy']['sell_profit_offset'] = 0.0 assert freqtrade.handle_trade(trade) is True + assert trade.sell_reason == SellType.SELL_SIGNAL.value