Remove further unnecessary method

This commit is contained in:
Matthias 2023-09-09 09:54:12 +02:00
parent 01ff054a0b
commit e76d4241a0
3 changed files with 3 additions and 12 deletions

View File

@ -609,7 +609,7 @@ class FreqtradeBot(LoggingMixin):
for trade in Trade.get_open_trades():
# If there is any open orders, wait for them to finish.
# TODO Remove to allow mul open orders
if trade.open_entry_or_exit_orders_count == 0:
if not trade.has_open_orders:
# Do a wallets update (will be ratelimited to once per hour)
self.wallets.update(False)
try:
@ -1231,7 +1231,7 @@ class FreqtradeBot(LoggingMixin):
self.handle_protections(trade.pair, trade.trade_direction)
return True
if trade.open_entry_or_exit_orders_count != 0 or not trade.is_open:
if trade.has_open_orders or not trade.is_open:
# Trade has an open Buy or Sell 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)

View File

@ -505,15 +505,6 @@ class LocalTrade:
]
return len(open_orders_wo_sl) > 0
@property
def open_entry_or_exit_orders_count(self) -> int:
open_buy_or_sell_orders = [
oo for oo in self.open_orders
if oo.ft_order_side in ['buy', 'sell']
]
return len(open_buy_or_sell_orders)
@property
def open_orders_ids(self) -> List[str]:
open_orders_ids_wo_sl = [

View File

@ -2984,7 +2984,7 @@ def test_manage_open_orders_buy_exception(
freqtrade.manage_open_orders()
assert cancel_order_mock.call_count == 0
assert rpc_mock.call_count == 1
assert open_trade.open_entry_or_exit_orders_count == 1
assert len(open_trade.open_orders) == 1
@pytest.mark.parametrize("is_short", [False, True])