Sell-fill -> exit_fill

This commit is contained in:
Matthias 2022-04-04 19:08:31 +02:00
parent 8b33d9cdb2
commit 0b88185c2c
9 changed files with 13 additions and 13 deletions

View File

@ -151,7 +151,7 @@
"stoploss_on_exchange": "off", "stoploss_on_exchange": "off",
"custom_exit": "off" "custom_exit": "off"
}, },
"sell_fill": "on", "exit_fill": "on",
"buy_cancel": "on", "buy_cancel": "on",
"exit_cancel": "on", "exit_cancel": "on",
"protection_trigger": "off", "protection_trigger": "off",

View File

@ -95,7 +95,7 @@ Example configuration showing the different settings:
"buy_cancel": "silent", "buy_cancel": "silent",
"exit_cancel": "on", "exit_cancel": "on",
"buy_fill": "off", "buy_fill": "off",
"sell_fill": "off", "exit_fill": "off",
"protection_trigger": "off", "protection_trigger": "off",
"protection_trigger_global": "on" "protection_trigger_global": "on"
}, },
@ -105,7 +105,7 @@ Example configuration showing the different settings:
``` ```
`buy` notifications are sent when the order is placed, while `buy_fill` notifications are sent when the order is filled on the exchange. `buy` notifications are sent when the order is placed, while `buy_fill` notifications are sent when the order is filled on the exchange.
`sell` notifications are sent when the order is placed, while `sell_fill` notifications are sent when the order is filled on the exchange. `sell` notifications are sent when the order is placed, while `exit_fill` notifications are sent when the order is filled on the exchange.
`*_fill` notifications are off by default and must be explicitly enabled. `*_fill` notifications are off by default and must be explicitly enabled.
`protection_trigger` notifications are sent when a protection triggers and `protection_trigger_global` notifications trigger when global protections are triggered. `protection_trigger` notifications are sent when a protection triggers and `protection_trigger_global` notifications trigger when global protections are triggered.

View File

@ -299,7 +299,7 @@ CONF_SCHEMA = {
} }
}, },
'exit_cancel': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS}, 'exit_cancel': {'type': 'string', 'enum': TELEGRAM_SETTING_OPTIONS},
'sell_fill': { 'exit_fill': {
'type': 'string', 'type': 'string',
'enum': TELEGRAM_SETTING_OPTIONS, 'enum': TELEGRAM_SETTING_OPTIONS,
'default': 'off' 'default': 'off'

View File

@ -15,7 +15,7 @@ class RPCMessageType(Enum):
SHORT_CANCEL = 'short_cancel' SHORT_CANCEL = 'short_cancel'
SELL = 'sell' SELL = 'sell'
SELL_FILL = 'sell_fill' EXIT_FILL = 'exit_fill'
EXIT_CANCEL = 'exit_cancel' EXIT_CANCEL = 'exit_cancel'
PROTECTION_TRIGGER = 'protection_trigger' PROTECTION_TRIGGER = 'protection_trigger'

View File

@ -1446,7 +1446,7 @@ class FreqtradeBot(LoggingMixin):
gain = "profit" if profit_ratio > 0 else "loss" gain = "profit" if profit_ratio > 0 else "loss"
msg = { msg = {
'type': (RPCMessageType.SELL_FILL if fill 'type': (RPCMessageType.EXIT_FILL if fill
else RPCMessageType.SELL), else RPCMessageType.SELL),
'trade_id': trade.id, 'trade_id': trade.id,
'exchange': trade.exchange.capitalize(), 'exchange': trade.exchange.capitalize(),

View File

@ -284,7 +284,7 @@ class Telegram(RPCHandler):
f" / {msg['profit_fiat']:.3f} {msg['fiat_currency']})") f" / {msg['profit_fiat']:.3f} {msg['fiat_currency']})")
else: else:
msg['profit_extra'] = '' msg['profit_extra'] = ''
is_fill = msg['type'] == RPCMessageType.SELL_FILL is_fill = msg['type'] == RPCMessageType.EXIT_FILL
message = ( message = (
f"{msg['emoji']} *{msg['exchange']}:* " f"{msg['emoji']} *{msg['exchange']}:* "
f"{'Exited' if is_fill else 'Exiting'} {msg['pair']} (#{msg['trade_id']})\n" f"{'Exited' if is_fill else 'Exiting'} {msg['pair']} (#{msg['trade_id']})\n"
@ -302,7 +302,7 @@ class Telegram(RPCHandler):
message += (f"*Current Rate:* `{msg['current_rate']:.8f}`\n" message += (f"*Current Rate:* `{msg['current_rate']:.8f}`\n"
f"*Close Rate:* `{msg['limit']:.8f}`") f"*Close Rate:* `{msg['limit']:.8f}`")
elif msg['type'] == RPCMessageType.SELL_FILL: elif msg['type'] == RPCMessageType.EXIT_FILL:
message += f"*Close Rate:* `{msg['close_rate']:.8f}`" message += f"*Close Rate:* `{msg['close_rate']:.8f}`"
return message return message
@ -312,7 +312,7 @@ class Telegram(RPCHandler):
RPCMessageType.SHORT_FILL]: RPCMessageType.SHORT_FILL]:
message = self._format_buy_msg(msg) message = self._format_buy_msg(msg)
elif msg_type in [RPCMessageType.SELL, RPCMessageType.SELL_FILL]: elif msg_type in [RPCMessageType.SELL, RPCMessageType.EXIT_FILL]:
message = self._format_sell_msg(msg) message = self._format_sell_msg(msg)
elif msg_type in (RPCMessageType.BUY_CANCEL, RPCMessageType.SHORT_CANCEL, elif msg_type in (RPCMessageType.BUY_CANCEL, RPCMessageType.SHORT_CANCEL,

View File

@ -53,7 +53,7 @@ class Webhook(RPCHandler):
valuedict = whconfig.get('webhookbuyfill', None) valuedict = whconfig.get('webhookbuyfill', None)
elif msg['type'] == RPCMessageType.SELL: elif msg['type'] == RPCMessageType.SELL:
valuedict = whconfig.get('webhookexit', whconfig.get('webhooksell', None)) valuedict = whconfig.get('webhookexit', whconfig.get('webhooksell', None))
elif msg['type'] == RPCMessageType.SELL_FILL: elif msg['type'] == RPCMessageType.EXIT_FILL:
valuedict = whconfig.get('webhookexitfill', whconfig.get('webhookexitfill', None)) valuedict = whconfig.get('webhookexitfill', whconfig.get('webhookexitfill', None))
elif msg['type'] == RPCMessageType.EXIT_CANCEL: elif msg['type'] == RPCMessageType.EXIT_CANCEL:
valuedict = whconfig.get('webhookexitcancel', valuedict = whconfig.get('webhookexitcancel',

View File

@ -2028,11 +2028,11 @@ def test_send_msg_sell_cancel_notification(default_conf, mocker) -> None:
def test_send_msg_sell_fill_notification(default_conf, mocker, direction, def test_send_msg_sell_fill_notification(default_conf, mocker, direction,
enter_signal, leverage) -> None: enter_signal, leverage) -> None:
default_conf['telegram']['notification_settings']['sell_fill'] = 'on' default_conf['telegram']['notification_settings']['exit_fill'] = 'on'
telegram, _, msg_mock = get_telegram_testobject(mocker, default_conf) telegram, _, msg_mock = get_telegram_testobject(mocker, default_conf)
telegram.send_msg({ telegram.send_msg({
'type': RPCMessageType.SELL_FILL, 'type': RPCMessageType.EXIT_FILL,
'trade_id': 1, 'trade_id': 1,
'exchange': 'Binance', 'exchange': 'Binance',
'pair': 'KEY/ETH', 'pair': 'KEY/ETH',

View File

@ -282,7 +282,7 @@ def test_send_msg_webhook(default_conf, mocker):
# Test Sell fill # Test Sell fill
msg_mock.reset_mock() msg_mock.reset_mock()
msg = { msg = {
'type': RPCMessageType.SELL_FILL, 'type': RPCMessageType.EXIT_FILL,
'exchange': 'Binance', 'exchange': 'Binance',
'pair': 'ETH/BTC', 'pair': 'ETH/BTC',
'gain': "profit", 'gain': "profit",