How to total up the profit/loss of two or more open trades(different currency pair)?

 
can anyone guide me how to total up ? why the function of "TotalProfit" in MQL II no longer be used in MQL4?
 
Here's TotalProfit() back:

double TotalProfit()
{
      int total  = OrdersTotal();
      double MyCurrentProfit=0;
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
         OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
         MyCurrentProfit += OrderProfit();
      }
      Return(MyCurrentProfit);
}

Hope it helps!
 
Thanks, Codersguru.
I tried and managed to total up all open trades P/L.

Further if we want to total the profit/loss of only 2 or 3 specific open trades out of 6 open trades (for example)
either the open trades are same /different pair of currency, how do we code it?
Your reply is appreciated. TQ.
 
double TotalProfit(string symbol)
{
      int total  = OrdersTotal();
      double MyCurrentProfit=0;
      for (int cnt = 0 ; cnt < total ; cnt++)
      {
         OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
 
         if (symbol != OrderSymbol()) continue;
 
         MyCurrentProfit += OrderProfit();
      }
      return(MyCurrentProfit);
}

So, you should call "TotalProfit" function for each symbol your EA can trade.
Reason: