I noticed that Quantopian started detecting that an order's status was 'held' by IB while IB was finding a short borrow locate. Two questions:
What is the 'official' way of programatically checking that the order is in the held state. I see that it corresponds to a order.status=4 and that the order.reason=u'Order held while securities are located' but checking for either of those seems a bit fragile since '4' is a magic number? Is there a list of status codes somewhere?
My code tried canceling that order multiple times but none of the cancels went through. Why? I've never had problems canceling held orders before and even with this one, I was easily able to cancel it manually w/ IB.