chore: add a warning log if custom_price_max_distance_ratio change the price
This commit is contained in:
@@ -2587,4 +2587,12 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
max_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)
|
||||||
|
|
||||||
# Bracket between min_custom_price_allowed and max_custom_price_allowed
|
# 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)
|
final_price = max(min(valid_custom_price, max_custom_price_allowed), min_custom_price_allowed)
|
||||||
|
|
||||||
|
# Log a warning if the custom price was adjusted by clamping.
|
||||||
|
if final_price != valid_custom_price:
|
||||||
|
logger.warning(
|
||||||
|
f"Custom price adjusted from {valid_custom_price} to {final_price} based on custom_price_max_distance_ratio of {cust_p_max_dist_r}."
|
||||||
|
)
|
||||||
|
|
||||||
|
return final_price
|
||||||
|
|||||||
Reference in New Issue
Block a user