i need to limit number of trades in one chart

 

iam using an expert which make many trades at the same moment i need to limit this number to 6 or 5 maximum 

is there any expert can help me

or if it is a code  please bind it to a link explaining how to enter that code inside the expert

 

 

Thanks ^^ 

 

this photo can make you understand more 

that ea opened about 17 positions of the same thing at the same moment and i needn't all 5 ..6 is enough

Files:
 
input MaxNumberOfTrades = 20;
...
...
...

int Start(){
   if(MaxNumberOfTrades < OrdersTotal() && .... && .... && ....)
      OrderSend(....);
   ....
}

But OrdersTotal() must be replaced with an other function that count orders based on the symbol itself insted of all symbols.

It is better to attach your code here to do it. 

 
Osama Shaban:
input MaxNumberOfTrades = 20;
...
...
...

int Start(){
   if(MaxNumberOfTrades < OrdersTotal() && .... && .... && ....)
      OrderSend(....);
   ....
}

But OrdersTotal() must be replaced with an other function that count orders based on the symbol itself insted of all symbols.

It is better to attach your code here to do it. 

^^

thanks much 

Reason: