Slight renaming of variable

This commit is contained in:
Matthias 2022-08-10 06:44:41 +02:00
parent 0b2104fc7a
commit ce2c9bf26d

View File

@ -661,7 +661,7 @@ class RPC:
return {'status': 'No more buy will occur from now. Run /reload_config to reset.'} return {'status': 'No more buy will occur from now. Run /reload_config to reset.'}
def __exec_force_exit(self, trade: Trade, ordertype: Optional[str], def __exec_force_exit(self, trade: Trade, ordertype: Optional[str],
_amount: Optional[float] = None) -> None: amount: Optional[float] = None) -> None:
# Check if there is there is an open order # Check if there is there is an open order
fully_canceled = False fully_canceled = False
if trade.open_order_id: if trade.open_order_id:
@ -683,14 +683,14 @@ class RPC:
order_type = ordertype or self._freqtrade.strategy.order_types.get( order_type = ordertype or self._freqtrade.strategy.order_types.get(
"force_exit", self._freqtrade.strategy.order_types["exit"]) "force_exit", self._freqtrade.strategy.order_types["exit"])
sub_amount: Optional[float] = None sub_amount: Optional[float] = None
if _amount and _amount < trade.amount: if amount and amount < trade.amount:
# Partial exit ... # Partial exit ...
min_exit_stake = self._freqtrade.exchange.get_min_pair_stake_amount( min_exit_stake = self._freqtrade.exchange.get_min_pair_stake_amount(
trade.pair, current_rate, trade.stop_loss_pct) trade.pair, current_rate, trade.stop_loss_pct)
remaining = (trade.amount - _amount) * current_rate remaining = (trade.amount - amount) * current_rate
if remaining < min_exit_stake: if remaining < min_exit_stake:
raise RPCException(f'Remaining amount of {remaining} would be too small.') raise RPCException(f'Remaining amount of {remaining} would be too small.')
sub_amount = _amount sub_amount = amount
self._freqtrade.execute_trade_exit( self._freqtrade.execute_trade_exit(
trade, current_rate, exit_check, ordertype=order_type, trade, current_rate, exit_check, ordertype=order_type,