limit order and the number of open order

 

so, if I have a max 2 order.

I open 1 order, and like 5 pending limit order.

How can I make sure that there is only 2 open order at a time?

 

What is the code of EA look like to stop those extra pending order to be executed? 

 
shonick: code of EA look like to stop those extra pending order to be executed? 

find the pending orders and delete them

Loops and Closing or Deleting Orders - MQL4 forum

 

I was thinking something to hold it, not to delete it. Guess, that is the only way.

Wow, I didn't realize there is an order of deleting also. Thanks a lot. 

 

Thanks 

Reason: