Add duration_explanation functions

This commit is contained in:
Matthias
2020-12-07 11:08:54 +01:00
parent c993831a04
commit 0e2a43ab4d
6 changed files with 63 additions and 14 deletions

View File

@@ -26,14 +26,14 @@ class LowProfitPairs(IProtection):
Short method description - used for startup-messages
"""
return (f"{self.name} - Low Profit Protection, locks pairs with "
f"profit < {self._required_profit} within {self._lookback_period} minutes.")
f"profit < {self._required_profit} within {self.lookback_period_str}.")
def _reason(self, profit: float) -> str:
"""
LockReason to use
"""
return (f'{profit} < {self._required_profit} in {self._lookback_period} min, '
f'locking for {self._stop_duration} min.')
return (f'{profit} < {self._required_profit} in {self.lookback_period_str}, '
f'locking for {self.stop_duration_str}.')
def _low_profit(self, date_now: datetime, pair: str) -> ProtectionReturn:
"""