OrdersTotal() and multiple pairs

 

I am trying to keep OrdersTotal() <=1 at any point in time.

If my EA is running simutaniously on multiple pairs say USDJPY and GBPJPY and they both meet the condtions for OrderSend() at the exact same time will OrderTotal() still remain at <=1? or will my condition be bypassed because both pairs had OrdersTotal() = 0 before the trade, causing both USDJPY and GBPJPY to send an Order and OrdersTotal() = 2?

 

Probably the best you can do is recheck OrdersTotal() immediately before OrderSend(). ..

if(OrdersTotal() == 0){

ticket = OrderSend(....);