Fix get_min_pair_stake_amount formula

This commit is contained in:
Théo Martin 2021-04-15 01:19:30 +01:00 committed by GitHub
parent 862df2b431
commit fa343b0484
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -539,7 +539,9 @@ 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 += abs(stoploss)
amount_reserve_percent = (
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)