simplify has_open_position property, restore process_open_trades_positions comment
This commit is contained in:
@@ -715,6 +715,8 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
"""
|
"""
|
||||||
# Walk through each pair and check if it needs changes
|
# Walk through each pair and check if it needs changes
|
||||||
for trade in Trade.get_open_trades():
|
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:
|
if not trade.has_open_orders:
|
||||||
# Do a wallets update (will be ratelimited to once per hour)
|
# Do a wallets update (will be ratelimited to once per hour)
|
||||||
self.wallets.update(False)
|
self.wallets.update(False)
|
||||||
|
|||||||
@@ -591,13 +591,7 @@ class LocalTrade:
|
|||||||
"""
|
"""
|
||||||
True if there is an open position for this trade
|
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]
|
return self.amount > 0
|
||||||
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
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def open_sl_orders(self) -> List[Order]:
|
def open_sl_orders(self) -> List[Order]:
|
||||||
|
|||||||
Reference in New Issue
Block a user