Total Commissions of all open orders.

Chee Chua  
Sorry forget to mention - MT5
lippmaje  
double SumUpCommissions(string symbol=NULL)
  {
   double sum=0;
   if(symbol==NULL) symbol=_Symbol;

   for(int i=PositionsTotal()-1; i>=0; i--)
     {
      if(PositionGetSymbol(i)==symbol)
         sum+=PositionGetDouble(POSITION_COMMISSION);
     }
   return sum;
  }
Here's a simple function that could be used in a script.
fxsaber  
Chee Chua:
Sorry forget to mention - MT5
#include <MT4Orders.mqh> // https://www.mql5.com/en/code/16006

double TotalCommission()
{
  double Sum = 0;
  
  for (int i = OrdersTotal() - 1; i >= 0; i--)
    if (OrderSelect(i, SELECT_BY_POS))
      Sum += OrderCommission();
      
  return(Sum);
}