Avoid dividing by 0 in get_min_pair_stake_amount

This commit is contained in:
Théo Martin 2021-04-15 01:01:24 +01:00 committed by GitHub
parent e2b4a73626
commit 94de194949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)