Avoid dividing by 0 in get_min_pair_stake_amount
This commit is contained in:
parent
e2b4a73626
commit
94de194949
@ -539,7 +539,7 @@ class Exchange:
|
||||
# reserve some percent defined in config (5% default) + stoploss
|
||||
amount_reserve_percent = 1.0 + self._config.get('amount_reserve_percent',
|
||||
DEFAULT_AMOUNT_RESERVE_PERCENT)
|
||||
amount_reserve_percent /= 1 - abs(stoploss)
|
||||
amount_reserve_percent /= 1 - abs(stoploss) if abs(stoploss) < 1 else 1.5
|
||||
# it should not be more than 50%
|
||||
amount_reserve_percent = max(min(amount_reserve_percent, 1.5), 1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user