Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 219
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
Artyom, I didn't start my answer with the words
The parabolic has strict alternation, two signals in one direction even on different bars are impossible. And you don't have to invent anything at all for that, it doesn't rattle even on zero bar, like the MA.
Rattling - I've noticed it more than once before. Maybe something has changed since then, but the point on the zero bar can disappear - it was.
I am proceeding as usual from the situation that later one may change the indicator for another one - and this block of code will already work independently - habit ...
Would it help? I posted a template there, from which you can make yourself what you want.
Thanks, applied it roughly, but it still feels like it sometimes changes SL immediately when a trade is opened.
Thank you, I applied it in an approximate way, but I still have a feeling that sometimes it changes SL immediately when a trade is opened.
Here is a question for you guys! Is there a limit to the number of digits in the magic number? How many digits should there be?
A magik is usually defined by an integer int type.
int
The integer int type has a size of 4 bytes (32 bits). Minimum value is -2,147,483,648, maximum value is 2,147,483,647.
Like this.
A magic is usually defined by the integer int type.
int
The integer int type has a size of 4 bytes (32 bits). Minimum value is -2,147,483,648, maximum value is 2,147,483,647.
Like this.
Thank you very much!
Hi all, I've written an EA and can't figure out the code. I need the function to run with every tick and every second of the server. I just called my function 2 times, throughOnTick and then throughOnTimer seems to have done everything correctly, but it still often misses a second and because of this sometimes does not work in the right moment. Help, who knows, would be very grateful). Perhaps because of a break in connection with the server ceases to work? Is it possible to make it run every second, even if there is a break in communication, and the seconds were strictly synchronized with the server time?
int OnInit()
{
EventSetTimer(1);
return(INIT_SUCCEEDED);
}
void OnTick()
{
Clicker (); //-- старт каждый тик
}
void OnTimer()
{
Clicker (); //-- старт каждую секунду
}
void Clicker()
{
//--- тут идёт порядка 30 строк кода, вырезал чтобы никого не грузить
Comment("Sek = " + (Seconds()));
return; // Выход из start()
}
I've written code that should determine the maximum Open price of the base for the last n bars, but for some reason the EA considers the maximum Open price of all the bars on the chart.
Thank you)
Friends, please help a beginner MQL4 programmer with some advice.
I have written a code that should determine the maximum Open price of the base for the last n bars, but the EA for some reason considers the maximum Open price of all the bars on the chart.
Thank you)
Try a function like this:
I have not looked at it, practically wrote it on my own, so I might have missed something.
I have understood my error, but I have not understood how to solve it. The task is normally started every second, but the time from the beginning of the current candle is not counted correctly.
The Seconds() function outputs seconds from the data of the last known tick, but I need to somehow count the real number of seconds since the opening of the minute candle at the moment the function is called, even if there were no ticks at all for the last couple of seconds.
TimeSeconds (TimeLocal()) or ( TimeLocal() - Time[0]) will not work either, because the local time can differ from the server by several seconds. How to solve the problem?