[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 1083
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
Tk write a ready-made one, because I'm just a beginner...
What is the log?
Shit, the file isn't yours - got it from a tutorial. Is it hard to attach it to your post? Just do it with the source code.
Tried your code. You got me wrong or you got it wrong! This code gives me a message every tick of formation of a new bar at any timeframe, and I need for example on M5 to give out after 5 minutes, as soon as it is completely formed every 1st bar. How to do it? Try this code yourself as an EA:
int start() // Спец. функция start
{
int New_Time;
Fun_New_Bar(); // Польз. ф-ия обнаружения нового бара
Alert("Сформировался новый бар"); // Вывод на экран
return; // Выход из start()
}
//--------------------------------------------------------------------
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; // Поймался новый бар
}
}
I HAVE A PROBLEM ....
When I set up mail in the terminal - I use smtp.gmail.com:25
I get the error - Mail: 530 5.7.0 Must issue a STARTTLS command first. l3sm2329679fan.0
I tried your code. You got me wrong or you got it wrong! This code gives me a message every tick of formation of a new bar at any timeframe, and I need for example on M5, to give out after 5 minutes, as soon as fully formed every 1-st bar. How to do it? Try this code yourself as an EA:
int start() // Спец. функция start
{
int New_Time;
Fun_New_Bar(); // Польз. ф-ия обнаружения нового бара
Alert("Сформировался новый бар"); // Вывод на экран
return; // Выход из start()
}
//--------------------------------------------------------------------
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; // Поймался новый бар
}
}
I didn't give you one, look carefully - I gave you another one:
Compare what you wrote inside the start() function and what I suggested to you. Are they the same thing?I didn't give you one, look carefully - I gave you another one:
Compare what you wrote inside the start() function and what I gave you. Are they the same thing?You should write it properly, because I don't understand it!
Write it out properly, because I don't understand it!
Take all subroutines out of the body of the start function - you cannot declare other functions within one function. You can call them. You cannot declare and describe them.
Remove all subprograms from the body of the start function - you cannot declare other subprograms inside one function. You can call them. Declare and describe - not allowed.
Right:
int start() // Спец. функция start
{
if(Fun_New_Bar())//проверка наличия нового бара
{
Alert("Сформировался новый бар"); // Вывод на экран
return; // Выход из start()
}
}
//--------------------------------------------------------------------
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; // Поймался новый бар
}
}
So:
int start() // Спец. функция start
{
if(Fun_New_Bar())//проверка наличия нового бара
{
Alert("Сформировался новый бар"); // Вывод на экран
return(0); // Выход из start()
}
}
//--------------------------------------------------------------------
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; // Поймался новый бар
}
}
It would be more accurate to put it this way:
It would be more accurate to put it this way:
I try it on M1 and after the next bar is formed the message doesn't come out. So what, it's not working?