How to cancel only parent order in bracket.
Suppose I want to cancel all sell orders. I do:
if self.order: for this_order in self.order: if this_order.issell(): self.cancel(this_order)
but what if some of these orders are children orders left from filled brackets orders:
--to keep the parlance of BT, main of the tripled
[main, stop, limit]was a buy and filled. Now stop and limit are left (two sells). I want to delete all orders that are both
mainand sells. How do I do that?
I meant how to cancel only child order in bracket (can't find the edit button on this forum somehow).
To cancel only parent order, can I use:
if self.order: for this_order in self.order: if this_order.issell(): if not isinstance(this_order.price, type(None)): cancel(this_order)