mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 02:12:01 +00:00
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:
|
||||
|
|
|
@ -393,6 +393,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,12 +113,16 @@ 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
|
||||
|
||||
|
||||
def _throttle(self, func: Callable[..., Any], throttle_secs: float, *args, **kwargs) -> Any:
|
||||
"""
|
||||
Throttles the given callable that it
|
||||
|
|
Loading…
Reference in New Issue
Block a user