[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 1082

 
sergeev:
I also have a stupid question. how did you know you were carrying ex4 ?
There are files in the root directory of Navigator Expert, I drag the file to the chart with my mouse... how else
 
kolyango:


I don't understand where the error occurred during compilation: '(' - function definition unexpected C:\Program Files (x86)\Alpari MT4\experts\start4.mq4 (5, 20)

The entry (5,20) means that the error is in the line 5, position 20.
 
kolyango:


I don't understand where the error occurred during compilation: '(' - function definition unexpected C:\Program Files (x86)\Alpari MT4\experts\start4.mq4 (5, 20)

//--------------------------------------------------------------------
int start() // Спец. функция start
{
int New_Time;
bool Fun_New_Bar() // Ф-ия обнаружения ..
{ // .. нового бара
static datetime New_Time=0; // Время текущего бара
bool New_Bar=false; // Нового бара нет
if(New_Time!=Time[0]) // Сравниваем время
{
New_Time=Time[0]; // Теперь время такое
New_Bar=true; // Поймался новый бар
Alert("Сформировался новый бар"); // Вывод на экран
return; // Выход из start()
}
}
//--------------------------------------------------------------------

There is an unspoken law in programming, how many brackets open - as many should be closed : { - 3 pcs, and } - 2 pieces. That's the answer.
 
kolyango:


I don't understand where the compilation error is: '(' - function definition unexpected C:\Program Files (x86)\Alpari MT4\experts\start4.mq4 (5, 20)

//--------------------------------------------------------------------
int start() // Спец. функция start
{
int New_Time;
bool Fun_New_Bar() // Ф-ия обнаружения ..
{ // .. нового бара
static datetime New_Time=0; // Время текущего бара
bool New_Bar=false; // Нового бара нет
if(New_Time!=Time[0]) // Сравниваем время
{
New_Time=Time[0]; // Теперь время такое
New_Bar=true; // Поймался новый бар
Alert("Сформировался новый бар"); // Вывод на экран
return; // Выход из start()
}
}
//--------------------------------------------------------------------

You should read the textbook, don't be lazy. Functions are placed outside the start() function

And you have to write them inside the start() function:

if(Fun_New_Bar())//проверка наличия нового бара
  {
   //а здесь разместить весь код эксперта
  }
 
Listen, but help me understand why when I try to drag an ex4 file onto a chart it doesn't work, what could be wrong, please?
 
mike2906:
Listen, but help me understand why when I try to drag an ex4 file onto a chart I get nothing, what could be wrong, please?
So the file is compiled with an error, or there is an error when the file is executed, look at the log.
 
mike2906:
Listen, but help me understand why when I try to drag an ex4 file onto a chart it doesn't work, what could be wrong, please?

Put the file here.
 
sanyooooook:
So the file is compiled with an error, or there is an error when the file is executed, check the log.
There is no error, this file I copied from the tutorial to learn the language from a small, i.e. I copied it to the navigator, opened, compiled (no errors), file ex4 appeared (all as taught), then, as the tutorial says, drag the mouse (left key) to the graph, but in place of the mouse on the graph lights up the icon circle crossed, and the file is not clinging to it
 
khorosh:


Tk write a ready-made one, because I'm just a beginner...
 
sanyooooook:
So the file is compiled with an error, or there is an error when the file is executed, check the log.
What is the log?