For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

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 main and 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)


  • @kav said in How to cancel only parent order in bracket.:

    I meant how to cancel only child order in bracket (can't find the edit button on this forum somehow).

    no, I really meant the parent order. Anyone knows where the edit button is on this forum?


Log in to reply
 

});