add property has_open_sl_orders to trade model

This commit is contained in:
Axel-CH
2023-10-04 13:09:44 -04:00
parent 753b807a45
commit cac777cb21

View File

@@ -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 = [