fix remaining amount check

This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி 2022-04-09 16:19:27 +05:30
parent a77e3ea378
commit e3a57ec3be
2 changed files with 111 additions and 108 deletions

3
.gitignore vendored
View File

@ -15,6 +15,9 @@ freqtrade/rpc/api_server/ui/*
# Macos related
.DS_Store
# git files after merging
*.orig
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

View File

@ -549,7 +549,7 @@ class FreqtradeBot(LoggingMixin):
# We should decrease our position
# Strategy should return value as Decimal for accuracy.
amount = abs(float(Decimal(stake_amount) / Decimal(current_exit_rate)))
if trade.amount - amount < min_exit_stake:
if (trade.amount - amount) * current_exit_rate < min_exit_stake:
logger.info('Remaining amount would be too small')
return
if amount > trade.amount: