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; }


![[XAUUSD]: Weekly Liquidity Activation Points (timings), June 22-26, 2026 [XAUUSD]: Weekly Liquidity Activation Points (timings), June 22-26, 2026](https://c.mql5.com/6/1013/splash-preview-771790.png)