Ensure non-defined attributes fail correctly

Remove unnecessary check, as stoploss cannot be none (it's mandatory and
a number)
This commit is contained in:
Matthias
2020-12-09 07:52:58 +01:00
parent d9a86158f4
commit f1af2972e2
3 changed files with 21 additions and 12 deletions

View File

@@ -519,8 +519,7 @@ class FreqtradeBot:
# reserve some percent defined in config (5% default) + stoploss
amount_reserve_percent = 1.0 - self.config.get('amount_reserve_percent',
constants.DEFAULT_AMOUNT_RESERVE_PERCENT)
if self.strategy.stoploss is not None:
amount_reserve_percent += self.strategy.stoploss
amount_reserve_percent += self.strategy.stoploss
# it should not be more than 50%
amount_reserve_percent = max(amount_reserve_percent, 0.5)