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.
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.
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())//проверка наличия нового бара
{
//а здесь разместить весь код эксперта
}
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
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I also have a stupid question. how did you know you were carrying ex4 ?
I don't understand where the error occurred during compilation: '(' - function definition unexpected C:\Program Files (x86)\Alpari MT4\experts\start4.mq4 (5, 20)
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()
}
}
//--------------------------------------------------------------------
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:
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?
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.
So the file is compiled with an error, or there is an error when the file is executed, check the log.
Tk write a ready-made one, because I'm just a beginner...
So the file is compiled with an error, or there is an error when the file is executed, check the log.