From 8b33d9cdb2b898890abbdb63b8b8f46be57e2240 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 4 Apr 2022 19:07:20 +0200 Subject: [PATCH] sell_cancel -> exit_cancel --- config_examples/config_full.example.json | 2 +- docs/telegram-usage.md | 2 +- freqtrade/constants.py | 2 +- freqtrade/enums/rpcmessagetype.py | 2 +- freqtrade/freqtradebot.py | 2 +- freqtrade/rpc/telegram.py | 2 +- freqtrade/rpc/webhook.py | 2 +- tests/rpc/test_rpc_telegram.py | 4 ++-- tests/rpc/test_rpc_webhook.py | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config_examples/config_full.example.json b/config_examples/config_full.example.json index f62f46293..59fa43a4f 100644 --- a/config_examples/config_full.example.json +++ b/config_examples/config_full.example.json @@ -153,7 +153,7 @@ }, "sell_fill": "on", "buy_cancel": "on", - "sell_cancel": "on", + "exit_cancel": "on", "protection_trigger": "off", "protection_trigger_global": "on" }, diff --git a/docs/telegram-usage.md b/docs/telegram-usage.md index 739c830bc..929dad80c 100644 --- a/docs/telegram-usage.md +++ b/docs/telegram-usage.md @@ -93,7 +93,7 @@ Example configuration showing the different settings: "custom_exit": "silent" }, "buy_cancel": "silent", - "sell_cancel": "on", + "exit_cancel": "on", "buy_fill": "off", "sell_fill": "off", "protection_trigger": "off", diff --git a/freqtrade/constants.py b/freqtrade/constants.py index 234f4472b..17f812167 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -298,7 +298,7 @@ CONF_SCHEMA = { 'enum': TELEGRAM_SETTING_OPTIONS } }, - 'sell_cancel': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS}, + 'exit_cancel': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS}, 'sell_fill': { 'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS, diff --git a/freqtrade/enums/rpcmessagetype.py b/freqtrade/enums/rpcmessagetype.py index 39cf1bda5..1e1011a94 100644 --- a/freqtrade/enums/rpcmessagetype.py +++ b/freqtrade/enums/rpcmessagetype.py @@ -16,7 +16,7 @@ class RPCMessageType(Enum): SELL = 'sell' SELL_FILL = 'sell_fill' - SELL_CANCEL = 'sell_cancel' + EXIT_CANCEL = 'exit_cancel' PROTECTION_TRIGGER = 'protection_trigger' PROTECTION_TRIGGER_GLOBAL = 'protection_trigger_global' diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index c50ed4972..6a34c8e26 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1497,7 +1497,7 @@ class FreqtradeBot(LoggingMixin): gain = "profit" if profit_ratio > 0 else "loss" msg = { - 'type': RPCMessageType.SELL_CANCEL, + 'type': RPCMessageType.EXIT_CANCEL, 'trade_id': trade.id, 'exchange': trade.exchange.capitalize(), 'pair': trade.pair, diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 43f6ce61d..5ff951bdf 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -316,7 +316,7 @@ class Telegram(RPCHandler): message = self._format_sell_msg(msg) elif msg_type in (RPCMessageType.BUY_CANCEL, RPCMessageType.SHORT_CANCEL, - RPCMessageType.SELL_CANCEL): + RPCMessageType.EXIT_CANCEL): msg['message_side'] = 'enter' if msg_type in [RPCMessageType.BUY_CANCEL, RPCMessageType.SHORT_CANCEL] else 'exit' message = ("\N{WARNING SIGN} *{exchange}:* " diff --git a/freqtrade/rpc/webhook.py b/freqtrade/rpc/webhook.py index 5c192377b..ef9924ce7 100644 --- a/freqtrade/rpc/webhook.py +++ b/freqtrade/rpc/webhook.py @@ -55,7 +55,7 @@ class Webhook(RPCHandler): valuedict = whconfig.get('webhookexit', whconfig.get('webhooksell', None)) elif msg['type'] == RPCMessageType.SELL_FILL: valuedict = whconfig.get('webhookexitfill', whconfig.get('webhookexitfill', None)) - elif msg['type'] == RPCMessageType.SELL_CANCEL: + elif msg['type'] == RPCMessageType.EXIT_CANCEL: valuedict = whconfig.get('webhookexitcancel', whconfig.get('webhooksellcancel', None)) elif msg['type'] in (RPCMessageType.STATUS, diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index b9089ca23..46d0f00de 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -1996,7 +1996,7 @@ def test_send_msg_sell_cancel_notification(default_conf, mocker) -> None: old_convamount = telegram._rpc._fiat_converter.convert_amount telegram._rpc._fiat_converter.convert_amount = lambda a, b, c: -24.812 telegram.send_msg({ - 'type': RPCMessageType.SELL_CANCEL, + 'type': RPCMessageType.EXIT_CANCEL, 'trade_id': 1, 'exchange': 'Binance', 'pair': 'KEY/ETH', @@ -2008,7 +2008,7 @@ def test_send_msg_sell_cancel_notification(default_conf, mocker) -> None: msg_mock.reset_mock() telegram.send_msg({ - 'type': RPCMessageType.SELL_CANCEL, + 'type': RPCMessageType.EXIT_CANCEL, 'trade_id': 1, 'exchange': 'Binance', 'pair': 'KEY/ETH', diff --git a/tests/rpc/test_rpc_webhook.py b/tests/rpc/test_rpc_webhook.py index b3c5fee93..6e1d4ee93 100644 --- a/tests/rpc/test_rpc_webhook.py +++ b/tests/rpc/test_rpc_webhook.py @@ -257,7 +257,7 @@ def test_send_msg_webhook(default_conf, mocker): # Test sell cancel msg_mock.reset_mock() msg = { - 'type': RPCMessageType.SELL_CANCEL, + 'type': RPCMessageType.EXIT_CANCEL, 'exchange': 'Binance', 'pair': 'ETH/BTC', 'gain': "profit",