Small fixes to align backtesting with live

This commit is contained in:
Matthias
2022-06-21 06:47:17 +02:00
parent 0bfb0febe9
commit 76907cb4d6
2 changed files with 4 additions and 3 deletions

View File

@@ -522,8 +522,8 @@ class Backtesting:
if stake_amount is not None and stake_amount < 0.0:
amount = abs(stake_amount) / current_rate
if amount > trade.amount:
# selling more than available is not supported.
return trade
# This is currently ineffective as remaining would become < min tradable
amount = trade.amount
remaining = (trade.amount - amount) * current_rate
if remaining < min_stake:
# Remaining stake is too low to be sold.