Update test to ensure direction of movement is correct

This commit is contained in:
Matthias
2021-08-18 20:20:11 +02:00
parent d97fc1e484
commit 9951f51079
2 changed files with 6 additions and 10 deletions

View File

@@ -1411,11 +1411,7 @@ class FreqtradeBot(LoggingMixin):
min_custom_price_allowed = proposed_price - (proposed_price * cust_p_max_dist_r)
max_custom_price_allowed = proposed_price + (proposed_price * cust_p_max_dist_r)
if valid_custom_price > max_custom_price_allowed:
valid_price = max_custom_price_allowed
elif valid_custom_price < min_custom_price_allowed:
valid_price = min_custom_price_allowed
else:
valid_price = valid_custom_price
return valid_price
# Bracket between min_custom_price_allowed and max_custom_price_allowed
return max(
min(valid_custom_price, max_custom_price_allowed),
min_custom_price_allowed)