Maximum draw down

 
how to identify maximum draw down for every trade in meta trader ???
 
gozila:
how to identify maximum draw down for every trade in meta trader ???
Find where price has gone between "now" and OrderOpenTime() and calculate the DD.
 
gozila: how to identify maximum draw down for every trade in meta trader ???

For open orders, Sum OrderProfit()   +OrderSwap()   +OrderCommission() for all open orders.

For closed orders, from Could EA Really Live By Order_History Alone? - MQL4 forum

   int      tickets[],     nTickets = GetHistoryOrderByCloseTime(tickets);
   double   balances[];    ArrayResize(balances,  nTickets+1);
   double   prevBal  = AccountBalance();
   for(int iTck = 0; iTck < nTickets; iTck++) if(
      OrderSelect(tickets[iTck], SELECT_BY_TICKET)
   ){
      double   profit   = OrderProfit()   +OrderSwap()   +OrderCommission();
      balances[iTck] = prevBal;  prevBal -= profit;
   }
   balances[nTickets]   = prevBal;
   int      iHiBal   = ArrayMaximum(balances),
            iLoBal   = ArrayMinimum(balances, iHiBal+1, 0);
   double   hiBal    = balances[iHiBal],
            loBal    = balances[iLoBal],
            DD       = hiBal-loBal;
Reason: