Rename login-mixin log method
This commit is contained in:
@@ -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()
|
||||
|
@@ -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.")
|
||||
|
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user