MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Trading functions  OrderProfit

 
double OrderProfit( )
Returns the net profit value (without swaps or commissions) for the selected order. For open positions, it is the current unrealized profit. For closed orders, it is the fixed profit.
Returns profit for the currently selected order.
Note: The order must be previously selected by the OrderSelect() function.
Sample:
  if(OrderSelect(10, SELECT_BY_POS)==true)
    Print("Profit for the order 10 ",OrderProfit());
  else
    Print("OrderSelect returned the error of ",GetLastError());