[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1022

 
ilmur:

I'm interested in where the error is...how do I find it?

Alpari\experts\PRIOR.mq4 (496, 16) in brackets numbers what do they mean?

496 line, 16 characters. Only the error can be much earlier
 
Vinin:

496 line, 16 characters. Only the error could be much earlier
found the error, the problem was in the bracket.....
 
Thank you ... no further questions
 

Great, yay, it's working...
 

antoma2:

Reshetov:
The OrderMagicNumber() function always returns 0 for manually opened positions. That is, the MAGICMA variable in the EA is not equal to 0.

Thank you. What is your advice? I am not a high-level programmer, I am just learning ;)

Set the MAGICMA variable to 0 to allow the EA to work with manually opened poses as their own.

 

'' - unexpected end of program

what could be the reason for this error?

Checked all brackets (curly, round, square) and ";" - all normal

 
} in such a bracket :) - comment out all function text /* */ - and uncomment a couple of brackets { } :) - by running compile....
 

I told you, I checked them out -_-

in pairs, in notepad+.

and I did the schematic before that:

int start()
{
for(new) //новые
{
 if(p1<p2)
   {
    for (1 tf)
    {
     for(2 tf)
      {}      
    }
   }

  if(p1>p2)
   {
    for (1 tf)
    {
     for(2 tf)
      {}
    }
   }
} //новые
}
 
eddy:

I told you, I checked them out -_-

in pairs, in notepad+.

and I did the schematic before that:

Why, it all compiles ;)))

What's for(1tf) ;))

LEARN https://book.mql4.com/ru/operators/for

int start(){
 for(;;){ //новые
  if(true)   {// уже не новые
    for (;;)    {// наверно старые ;))
     for(;;)      {
     }      
    }
  }
  if(true)   {
    for (;;)    {
     for(;;)      {
     }
    }
  }
 } //новые
}

Try to make your code "readable", less hassle later.

void init(){  
  SymbolName = ...;
  FileName = SymbolName + Period() + ".hst";
  handle = FileOpenHistory(...);
  if(...<0){         //файла нет
    ...;     //создаем заголовок
    ...;  //смещаем от начала на 148байт
    ...;    //пишем все бары
  }else{                //файл есть
    ...;  //закрываем  
    ...; // откроем для редактирования
    ...;  //смещаем на 2бара назад
    ...; //читаем дату
    ...;  //смещаем на 4 прочитанных байта назад от текущего положения
    ...;
    ...;
  }
}
 
for (1 tf) это для понятности просто, не суть то
Reason: