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",
"custom_exit": "off"
},
"sell_fill": "on",
"exit_fill": "on",
"buy_cancel": "on",
"exit_cancel": "on",
"protection_trigger": "off",

View File

@ -95,7 +95,7 @@ Example configuration showing the different settings:
"buy_cancel": "silent",
"exit_cancel": "on",
"buy_fill": "off",
"sell_fill": "off",
"exit_fill": "off",
"protection_trigger": "off",
"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.
`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.
`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},
'sell_fill': {
'exit_fill': {
'type': 'string',
'enum': TELEGRAM_SETTING_OPTIONS,
'default': 'off'

View File

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

View File

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

View File

@ -284,7 +284,7 @@ class Telegram(RPCHandler):
f" / {msg['profit_fiat']:.3f} {msg['fiat_currency']})")
else:
msg['profit_extra'] = ''
is_fill = msg['type'] == RPCMessageType.SELL_FILL
is_fill = msg['type'] == RPCMessageType.EXIT_FILL
message = (
f"{msg['emoji']} *{msg['exchange']}:* "
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"
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}`"
return message
@ -312,7 +312,7 @@ class Telegram(RPCHandler):
RPCMessageType.SHORT_FILL]:
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)
elif msg_type in (RPCMessageType.BUY_CANCEL, RPCMessageType.SHORT_CANCEL,

View File

@ -53,7 +53,7 @@ class Webhook(RPCHandler):
valuedict = whconfig.get('webhookbuyfill', None)
elif msg['type'] == RPCMessageType.SELL:
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))
elif msg['type'] == RPCMessageType.EXIT_CANCEL:
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,
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.send_msg({
'type': RPCMessageType.SELL_FILL,
'type': RPCMessageType.EXIT_FILL,
'trade_id': 1,
'exchange': 'Binance',
'pair': 'KEY/ETH',

View File

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