Correct conditions for remaining stake checking

This commit is contained in:
Matthias
2023-12-14 20:34:58 +01:00
parent bb2024f789
commit 9e2e60e7ad
2 changed files with 2 additions and 5 deletions
+1 -1
View File
@@ -685,7 +685,7 @@ class FreqtradeBot(LoggingMixin):
return return
remaining = (trade.amount - amount) * current_exit_rate remaining = (trade.amount - amount) * current_exit_rate
if min_exit_stake and (0 < remaining < min_exit_stake): if min_exit_stake and remaining != 0 and remaining < min_exit_stake:
logger.info(f"Remaining amount of {remaining} would be smaller " logger.info(f"Remaining amount of {remaining} would be smaller "
f"than the minimum of {min_exit_stake}.") f"than the minimum of {min_exit_stake}.")
return return
+1 -4
View File
@@ -568,11 +568,8 @@ class Backtesting:
self.precision_mode, trade.contract_size) self.precision_mode, trade.contract_size)
if amount == 0.0: if amount == 0.0:
return trade return trade
if amount > trade.amount:
# This is currently ineffective as remaining would become < min tradable
amount = trade.amount
remaining = (trade.amount - amount) * current_rate remaining = (trade.amount - amount) * current_rate
if 0 < remaining < min_stake: if remaining != 0 and remaining < min_stake:
# Remaining stake is too low to be sold. # Remaining stake is too low to be sold.
return trade return trade
exit_ = ExitCheckTuple(ExitType.PARTIAL_EXIT) exit_ = ExitCheckTuple(ExitType.PARTIAL_EXIT)