Rename login-mixin log method

This commit is contained in:
Matthias
2020-11-19 19:45:22 +01:00
parent 2e5b9fd4b2
commit 8ebd6ad200
11 changed files with 34 additions and 36 deletions

View File

@@ -41,7 +41,7 @@ class CooldownPeriod(IProtection):
]
trade = Trade.get_trades(filters).first()
if trade:
self.log_on_refresh(logger.info, f"Cooldown for {pair} for {self._stop_duration}.")
self.log_once(logger.info, f"Cooldown for {pair} for {self._stop_duration}.")
until = self.calculate_lock_end([trade], self._stop_duration)
return True, until, self._reason()

View File

@@ -52,7 +52,7 @@ class LowProfitPairs(IProtection):
profit = sum(trade.close_profit for trade in trades)
if profit < self._required_profit:
self.log_on_refresh(
self.log_once(
logger.info,
f"Trading for {pair} stopped due to {profit:.2f} < {self._required_profit} "
f"within {self._lookback_period} minutes.")

View File

@@ -53,8 +53,8 @@ class StoplossGuard(IProtection):
trades = Trade.get_trades(filters).all()
if len(trades) > self._trade_limit:
self.log_on_refresh(logger.info, f"Trading stopped due to {self._trade_limit} "
f"stoplosses within {self._lookback_period} minutes.")
self.log_once(logger.info, f"Trading stopped due to {self._trade_limit} "
f"stoplosses within {self._lookback_period} minutes.")
until = self.calculate_lock_end(trades, self._stop_duration)
return True, until, self._reason()