OrderProfit - Trade Functions - MQL4 Reference

MQL4 Reference Trade Functions 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.


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


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