Add protections to startup messages

This commit is contained in:
Matthias
2020-12-07 10:54:37 +01:00
parent d4799e6aa3
commit c993831a04
3 changed files with 14 additions and 5 deletions

View File

@@ -137,7 +137,7 @@ class FreqtradeBot(LoggingMixin):
Called on startup and after reloading the bot - triggers notifications and
performs startup tasks
"""
self.rpc.startup_messages(self.config, self.pairlists)
self.rpc.startup_messages(self.config, self.pairlists, self.protections)
if not self.edge:
# Adjust stoploss if it was changed
Trade.stoploss_reinitialization(self.strategy.stoploss)

View File

@@ -62,7 +62,7 @@ class RPCManager:
except NotImplementedError:
logger.error(f"Message type '{msg['type']}' not implemented by handler {mod.name}.")
def startup_messages(self, config: Dict[str, Any], pairlist) -> None:
def startup_messages(self, config: Dict[str, Any], pairlist, protections) -> None:
if config['dry_run']:
self.send_msg({
'type': RPCMessageType.WARNING_NOTIFICATION,
@@ -90,3 +90,8 @@ class RPCManager:
'status': f'Searching for {stake_currency} pairs to buy and sell '
f'based on {pairlist.short_desc()}'
})
if len(protections.name_list) > 0:
self.send_msg({
'type': RPCMessageType.STARTUP_NOTIFICATION,
'status': f'Using Protections {protections.short_desc()}'
})