orderstotal() in different charts

 
Hi,
I am running a same EA on different currency pairs. I wanted only 1 trade opened for any currency pair at one time. For e.g I would need only 1 trade opened for EURUSD, other opened trades can be of different currency pair but not EURUSD, when there is already open trade for this pair. Can any body help me with that ???
 
int    i,total,my_total;
string symbol;
 
symbol=Symbol();
total=OrdersTotal();
my_total=0;
for(i=0; i<total; i++)
  {
   OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
   if(OrderSymbol()==symbol) my_total++;
  }
You can use other checking instead of OrderSymbol()==symbol
Reason: