Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Cancelling limit order when stop order is hit and vice versa.

Basically I am talking about setting up a stop loss and take profit order such that the other one cancels when one is hit. Its pretty clear how to cancel order but not HOW TO CHECK IF A PARTICULAR ORDER HAS BEEN HIT or even the if I am able to check it might be too late as the prices move too fast. So basically I want to cancel the other order AS SOON AS OR IMMEDIATELY AFTER ONE IS HIT.I would be glad if someone could help me with this.