updated requested changes in PR #6545

This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி
2022-03-24 13:10:08 +05:30
parent 6eb2e51bfc
commit 14c8c6ad87
2 changed files with 3 additions and 7 deletions

View File

@@ -482,14 +482,11 @@ class FreqtradeBot(LoggingMixin):
if stake_amount is not None and stake_amount < 0.0:
# We should decrease our position
# Strategy should return value as Decimal.
# Strategy should return value as Decimal for accuracy.
amount = abs(float(Decimal(stake_amount) / Decimal(current_exit_rate)))
if trade.amount - amount < min_stake_amount:
logger.info('Remaining amount would be too small')
return
if amount > trade.amount:
logger.info(f"Amount is higher than available. {amount} > {trade.amount}")
return
self.execute_trade_exit(trade, current_exit_rate, sell_reason=SellCheckTuple(
sell_type=SellType.CUSTOM_SELL), sub_trade_amt=amount)