PositionGetSymbol - empty string

 
    positions = PositionsTotal();
    if(positions == 0) return(true);
    for(int i=0; i < positions; i++)//for every position open
      {
       position_symbol = PositionGetSymbol(i);
       ticket = PositionGetInteger(POSITION_TICKET);

Три открытых позиции. PositionsTotal() возвращает три.

При переборе в цикле при i = 2, PositionGetSymbol(i) возвращает пустую строку.

Почему он не находит позицию? 

При проверке возвращает наличие ошибки 4753 "Позиция не найдена".

 
You should use the Russian forum.
 
Alain Verleyen:
You should use the Russian forum.

I though I use Russian.

I saw you have answered similar question several time. I get error 4753 in the third loop of cycle (i = 2). 

 
Oleg Shenker:

I though I use Russian.

I saw you have answered similar question several time. I get error 4753 in the third loop of cycle (i = 2). 

Are you doing something to the position in the rest of the code?

Since this loop :

   string position_symbol = "";
      if (PositionsTotal() == 0) return(true);
         ResetLastError();
         for(int i=PositionsTotal()-1; i>=0 && GetLastError()==0; i--)
            position_symbol += PositionGetSymbol(i)+"\n";
        
      Comment(position_symbol+"\nLast error : "+(string)GetLastError());

causes no error (regardless of how many positions are currently opened)

Reason: