fix flake8 and mypy
This commit is contained in:
parent
256588af48
commit
729ccdb2d7
@ -9,6 +9,7 @@ from freqtrade.plugins.protections import IProtection, ProtectionReturn
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ProfitLimit(IProtection):
|
||||
|
||||
has_global_stop: bool = True
|
||||
@ -47,8 +48,8 @@ class ProfitLimit(IProtection):
|
||||
# Not enough trades in the relevant period
|
||||
return None
|
||||
|
||||
profit_sum = trades['profit_abs'].sum()
|
||||
stake_sum = trades['stake_amount'].sum()
|
||||
profit_sum = sum(trade.close_profit_abs for trade in trades if trade.close_profit_abs)
|
||||
stake_sum = sum(trade.stake_amount for trade in trades)
|
||||
profit_ratio = profit_sum / stake_sum
|
||||
|
||||
if profit_ratio >= self._required_profit:
|
||||
|
Loading…
Reference in New Issue
Block a user