is there a way...
loop through OrdersHistoryTotal() filtering by OrderSymbol() and summing up OrderProfit() + OrderSwap() for all applicable trades.
loop through OrdersHistoryTotal() filtering by OrderSymbol() and summing up OrderProfit() + OrderSwap() for all applicable trades.
Im sorry, I explained it wrong.
I am looking for current pair equity.
so lets say i have 4 trades open I want to know when combined if they are in profit or loss.
Im sorry, I explained it wrong.
I am looking for current pair equity.
so lets say i have 4 trades open I want to know when combined if they are in profit or loss.
Nevermind Figured it out, Thanks
Try this: Sums profit/loss values for current open orders.
double ProfitOpenOrders() { double value=0; for (int i=0; i<OrdersTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) if((OrderSymbol()==Symbol()) && OrderMagicNumber() == MagicNumber) { value+=OrderProfit(); } } return(value); }
I am trying to figure out if there is a way in MT4 to return the profit value of a specific pair.
Exactly what the AccountProfit() returns, except only each individual pair's profit.
Thanks