From 0b5544ef9e521055196e5e3e2ddfc331156432e0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 22 May 2022 19:16:31 +0200 Subject: [PATCH] Stoploss fill should fill as "filled" notification Closes #6873 --- freqtrade/constants.py | 4 ++-- freqtrade/freqtradebot.py | 2 +- tests/test_freqtradebot.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/constants.py b/freqtrade/constants.py index 372472db8..9fbd70e42 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -302,12 +302,12 @@ CONF_SCHEMA = { 'exit_fill': { 'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS, - 'default': 'off' + 'default': 'on' }, 'protection_trigger': { 'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS, - 'default': 'off' + 'default': 'on' }, 'protection_trigger_global': { 'type': 'string', diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 3dccb45e4..a8e1fa31f 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1019,7 +1019,7 @@ class FreqtradeBot(LoggingMixin): # Lock pair for one candle to prevent immediate rebuys self.strategy.lock_pair(trade.pair, datetime.now(timezone.utc), reason='Auto lock') - self._notify_exit(trade, "stoploss") + self._notify_exit(trade, "stoploss", True) return True if trade.open_order_id or not trade.is_open: diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index d2df4e6a5..23ef4ffc2 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -3582,7 +3582,7 @@ def test_may_execute_trade_exit_after_stoploss_on_exchange_hit( assert rpc_mock.call_count == 3 assert rpc_mock.call_args_list[0][0][0]['type'] == RPCMessageType.ENTRY assert rpc_mock.call_args_list[1][0][0]['type'] == RPCMessageType.ENTRY_FILL - assert rpc_mock.call_args_list[2][0][0]['type'] == RPCMessageType.EXIT + assert rpc_mock.call_args_list[2][0][0]['type'] == RPCMessageType.EXIT_FILL @pytest.mark.parametrize(