Telegram and log prints strategy version.
This commit is contained in:
parent
06c81b5234
commit
d4fd13bf50
@ -1304,7 +1304,11 @@ class Telegram(RPCHandler):
|
||||
:param update: message update
|
||||
:return: None
|
||||
"""
|
||||
self._send_msg('*Version:* `{}`'.format(__version__))
|
||||
strategy_version = self._rpc._freqtrade.strategy.version()
|
||||
if strategy_version is None:
|
||||
self._send_msg('*Version:* `{}`'.format(__version__))
|
||||
else:
|
||||
self._send_msg('*Freqtrade version:* `{}`, *Strategy version:* `{}`'.format(__version__, strategy_version))
|
||||
|
||||
@authorized_only
|
||||
def _show_config(self, update: Update, context: CallbackContext) -> None:
|
||||
|
@ -394,6 +394,12 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
"""
|
||||
return []
|
||||
|
||||
def version(self) -> str:
|
||||
"""
|
||||
Returns version of the strategy.
|
||||
"""
|
||||
return None
|
||||
|
||||
###
|
||||
# END - Intended to be overridden by strategy
|
||||
###
|
||||
|
@ -113,8 +113,12 @@ class Worker:
|
||||
if self._heartbeat_interval:
|
||||
now = time.time()
|
||||
if (now - self._heartbeat_msg) > self._heartbeat_interval:
|
||||
version = __version__
|
||||
strategy_version = self.freqtrade.strategy.version()
|
||||
if (strategy_version != None):
|
||||
version += ', strategy_version: ' + strategy_version
|
||||
logger.info(f"Bot heartbeat. PID={getpid()}, "
|
||||
f"version='{__version__}', state='{state.name}'")
|
||||
f"version='{version}', state='{state.name}'")
|
||||
self._heartbeat_msg = now
|
||||
|
||||
return state
|
||||
|
Loading…
Reference in New Issue
Block a user