One Cancel Other

 

Hi everyone,

 I'm new here and I was trying to search for One Cancel Other but it didn't give me much of a result.

 May I ask which "department" is the below function under? (expert advisor, indicator or something else)

 Situation:

After I opened a trade, I will open another pending trade on the same pair.

If the existing trade is exited (Take profit), it will cancel my pending trade.

 There will be times where my pending trade will be triggered and filled. And if that happens, I will have 2 open positions so the OCO is not longer needed

 

I hope I make sense above. I do hope someone can point me in the right direction. Thank you and have a good day! 

 

I am not sure that it will help but I just found the simuilar thread about it (with replies):

 

all you need to do is count active orders (buy/sell)

if no active orders then delete all pending orders 

Reason: