ivant / Publications
Forum
UPDATE MARKET POSITION INSTANTLY
Hello, I am trying to get current market position(nr. of lots and direction) like this : int OpenPosQTY() { int cnt = 0; int lots = 0; for (int ic = OrdersTotal() - 1; ic >= 0; ic--) { OrderSelect(ic, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol() == Symbol()) { if (OrderType() == OP_BUY) cnt++; if