Hi I need some help with this. Basically; i have an algo that submit trades using a StopMarketOrder for both long and short positions. When the order has been filled, it will create a limit (Take Profit) and StopMarketOrder (StopLoss) at the orderevent. 

 

The ticket ID for when it first created the long and short is called self.Ticket and self.Ticket2 respectively. 

 

How do i differentiate the StopMarketOrder in the orderevent to trigger to cancel the open orders if lets say the stop loss is triggered. I'm having trouble to manage this.