Skip to content

Commit

Permalink
Stoploss fill should fill as "filled" notification
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed May 22, 2022
1 parent 1315d02 commit 0b5544e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions freqtrade/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,12 @@
'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',
Expand Down
2 changes: 1 addition & 1 deletion freqtrade/freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ def handle_stoploss_on_exchange(self, trade: Trade) -> bool:
# 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:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 0b5544e

Please sign in to comment.