Download MetaTrader 5

Better get an orders current profit

To add comments, please log in or register
Michael
718
Michael  

Not talking pips here.

But which formula is more accurate:

double TotalProfit=OrderProfit();

or

double TotalProfit=OrderProfit()+OrderSwap()+OrderCommission();
In other words, does OrderProfit() automatically include OrderSwap() and OrderCommission()?
Marco vd Heijden
Moderator
6147
Marco vd Heijden  

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.

You could check the documentation.

https://docs.mql4.com/trading/orderprofit

OrderProfit - Trade Functions - MQL4 Reference
OrderProfit - Trade Functions - MQL4 Reference
  • docs.mql4.com
OrderProfit - Trade Functions - MQL4 Reference
To add comments, please log in or register