0
73
double getProfitOfOrderPair(string pair) { double pProfit = 0.0; for (int i = OrdersTotal() - 1; i >= 0; i--) // returns the number of open positions { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if(OrderComment() == pair) { pProfit = pProfit + OrderProfit() + OrderSwap() + OrderCommission(); } } } return pProfit; }