Orderlots in mql5
Hi.
How can i get the same function as OrderLots() in mql5? Alternative?
Dejan Krapež:
Hi.
Hi.
How can i get the same function as OrderLots() in mql5? Alternative?
double PosLots=PositionGetDouble(POSITION_VOLUME);
Dejan Krapež:
Hi.
Hi.
How can i get the same function as OrderLots() in mql5? Alternative?
double TOL_B = 0; // Total Lots of Open Buy positions for(int i=PositionsTotal()-1; i>=0; i--) if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==m_magic && m_position.PositionType()==POSITION_TYPE_BUY) TOL_B += PositionGetDouble(POSITION_VOLUME); double TOL_S = 0; // Total Lots of Open Sell positions for(int i=PositionsTotal()-1; i>=0; i--) if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==m_magic && m_position.PositionType()==POSITION_TYPE_SELL)- TOL_S += PositionGetDouble(POSITION_VOLUME); double Overall_Lots = TOL_B + TOL_S;