mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 02:12:01 +00:00
remove irrelevant trade.has_open_orders conditions
This commit is contained in:
parent
730bef2920
commit
33b421014d
|
@ -1246,8 +1246,7 @@ class FreqtradeBot(LoggingMixin):
|
|||
trades_closed = 0
|
||||
for trade in trades:
|
||||
if (
|
||||
not trade.has_open_orders
|
||||
and not trade.has_open_sl_orders
|
||||
not trade.has_open_sl_orders
|
||||
and not self.wallets.check_exit_amount(trade)
|
||||
):
|
||||
logger.warning(
|
||||
|
@ -1272,7 +1271,7 @@ class FreqtradeBot(LoggingMixin):
|
|||
f"Unable to handle stoploss on exchange for {trade.pair}: {exception}"
|
||||
)
|
||||
# Check if we can sell our current pair
|
||||
if trade.has_untied_assets and trade.is_open and self.handle_trade(trade):
|
||||
if trade.is_open and self.handle_trade(trade):
|
||||
trades_closed += 1
|
||||
|
||||
except DependencyException as exception:
|
||||
|
@ -1416,7 +1415,7 @@ class FreqtradeBot(LoggingMixin):
|
|||
self.handle_protections(trade.pair, trade.trade_direction)
|
||||
return True
|
||||
|
||||
if trade.has_open_orders or not trade.is_open:
|
||||
if not trade.is_open:
|
||||
# Trade has an open order, Stoploss-handling can't happen in this case
|
||||
# as the Amount on the exchange is tied up in another trade.
|
||||
# The trade can be closed already (sell-order fill confirmation came in this iteration)
|
||||
|
|
|
@ -1377,8 +1377,7 @@ class Backtesting:
|
|||
self.wallets.update()
|
||||
|
||||
# 4. Create exit orders (if any)
|
||||
if trade.has_open_position:
|
||||
self._check_trade_exit(trade, row, current_time) # Place exit order if necessary
|
||||
self._check_trade_exit(trade, row, current_time) # Place exit order if necessary
|
||||
|
||||
# 5. Process exit orders.
|
||||
order = trade.select_order(trade.exit_side, is_open=True)
|
||||
|
|
Loading…
Reference in New Issue
Block a user