mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 12:13:57 +00:00
simplify has_open_position property, restore process_open_trades_positions comment
This commit is contained in:
parent
5ba592ff47
commit
beebc1743a
|
@ -715,6 +715,8 @@ class FreqtradeBot(LoggingMixin):
|
|||
"""
|
||||
# Walk through each pair and check if it needs changes
|
||||
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 not trade.has_open_orders:
|
||||
# Do a wallets update (will be ratelimited to once per hour)
|
||||
self.wallets.update(False)
|
||||
|
|
|
@ -591,13 +591,7 @@ class LocalTrade:
|
|||
"""
|
||||
True if there is an open position for this trade
|
||||
"""
|
||||
entry_orders = [o for o in self.orders if o.ft_order_side == self.entry_side]
|
||||
entry_orders_filled_qty = sum(eno.safe_filled for eno in entry_orders)
|
||||
|
||||
exit_orders = [o for o in self.orders if o.ft_order_side == self.exit_side]
|
||||
exit_orders_filled_qty = sum(exo.safe_filled for exo in exit_orders)
|
||||
|
||||
return (entry_orders_filled_qty - exit_orders_filled_qty) > 0
|
||||
return self.amount > 0
|
||||
|
||||
@property
|
||||
def open_sl_orders(self) -> List[Order]:
|
||||
|
|
Loading…
Reference in New Issue
Block a user