OrderProfit - Trade Functions - MQL4 Reference

MQL4 Reference Trade Functions OrderProfit

OrderProfit

Returns profit of the currently selected order.

double  OrderProfit();

Returned value

The net profit value (without swaps or commissions) for the selected order. For open orders, it is the current unrealized profit. For closed orders, it is the fixed profit.

Note

The order must be previously selected by the OrderSelect() function.

Example:

  if(OrderSelect(10, SELECT_BY_POS)==true)
    Print("Profit for the order 10 ",OrderProfit());
  else
    Print("OrderSelect returned the error of ",GetLastError());