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());
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)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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 "Позиция не найдена".