Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1392

 

Greetings. Can you give me a hint?

If I understand correctly, the execution of OnTick() occurs when a new tick arrives and provided that the execution (after the previous tick) is already finished.

Hence the question: what time of execution ofOnTick() is considered normal and what is already a long time?

 
And another question: the Expert Advisor has a trading algorithm and a graphic design. Is it possible to organize the priority of algorithmic trading over the visual design? And if so, how?
 
Andrey Sokolov:

Greetings. Can you give me a hint?

If I understand correctly, the execution of OnTick() occurs when a new tick arrives and provided that the execution (after the previous tick) is already finished.

Hence the question: what time of execution ofOnTick() is considered normal and what time is already long?

It depends on the tool. If there are only 3-5 milliseconds between ticks, execution of OnTick() should not be longer. And there are such tools where the tick is delayed up to 1 second or even more.

 
Andrey Sokolov:
And another question: my Expert Advisor has algorithmic trading and graphical visualization. Is it possible to arrange the trading algorithms' priority over the visual design? And if so, how?

Does this visual design change on every tick? Is it enough to insert it in OnInit()?

 
Alexey Viktorov:

Does this visual design change on every tick? Maybe it is enough to insert it into OnInit()?

There are different counts in the panel and objects on the chart that change.


If at the time of OnTimer() execution a new tick occurs, what is executed and in what order?

 
Andrey Sokolov:

There are different counts in the panel and objects in the graph that change.


If a new tick occurs while OnTimer() is running, what is done and in what order?

On a first-come, first-served basis
 
MakarFX:
In order of priority

If it's not a secret, can I get a link to the source of the information?

There is some doubt thatOnTick() will be executed in this case.

 
Andrey Sokolov:

If a new tick occurs during the execution of OnTimer(), what and in what order is it executed?

not in any order

if a new event occurs during complex calculations inside the OnTimer() or OnTick() function, it will be skipped

search through the forum "tick skipping" should find a discussion and admins have repeatedly written about it

by the way, in MT4 for synchronization with new tick data there was RefreshRates() - maybe even in the help about this function there is a mention of tick skipping

 
Andrey Sokolov:

If it's not a secret, can I get a link to the source of the information?

There is some doubt thatOnTick() will be executed in this case.

Andrey Sokolov:

There are different counts in the panel and objects on the chart that change.

If a new tick is executed during OnTimer(), what is executed and in what order?

If there is OnTimer() everything else is queued except the new OnTimer() - it is skipped.

I had a similar situation and put OnTimer() before OnTick() and ran EventSetMillisecondTimer(100).

Finally I solved my problem.

 

Igor Makanu, MakarFX, which one of you is right? Let's try to find the description and find out. I've seen it once, but I can't find it all day long.


Another tip, please: if there is more than one EA in the terminal, in what order will they process ticks, if their processing takes more time than pause between ticks?

Reason: