How to control orders numbers per pair using an EA ?

 
Hi. I'de control numbers of order to 4 trades for each pair symbol using an EA. Can you help me ?
 
Davidafx:
Hi. I'de control numbers of order to 4 trades for each pair symbol using an EA. Can you help me ?
Loop through all the orders,  count how many are open for each pair,  if a pair has the max you want to allow don't allow any more to be placed for that pair.
 
I'm using the same EA for each pair. So how to control them independly ? The problem is that the orders are limited at 4 trades (total) for all pairs but I want 4 trades for each pair.
 
Davidafx:
I'm using the same EA for each pair. So how to control them independly ? The problem is that the orders are limited at 4 trades (total) for all pairs but I want 4 trades for each pair.
Change the limit in the code from 4 total to 4 per pair . . .   isn't it obvious ?
 
Can you explain me with some code lines ?
 
Davidafx:
Can you explain me with some code lines ?
Of course, what have you tried ?
Reason: