mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 16:43:06 +00:00
add property has_open_sl_orders to trade model
This commit is contained in:
@@ -523,6 +523,17 @@ class LocalTrade:
|
||||
]
|
||||
return len(open_orders_wo_sl) > 0
|
||||
|
||||
@property
|
||||
def has_open_sl_orders(self) -> int:
|
||||
"""
|
||||
True if there are open stoploss orders for this trade
|
||||
"""
|
||||
open_sl_orders = [
|
||||
o for o in self.orders
|
||||
if o.ft_order_side in ['stoploss'] and o.ft_is_open
|
||||
]
|
||||
return len(open_sl_orders) > 0
|
||||
|
||||
@property
|
||||
def open_orders_ids(self) -> List[str]:
|
||||
open_orders_ids_wo_sl = [
|
||||
|
||||
Reference in New Issue
Block a user