Wishes for MT5 - page 51

 
Yedelkin:

Explanation. If an Expert Advisor does not process ticks for the symbol to which it is attached to a chart, the continuous generation ofNewTick events for that symbol will lead to an overflow of the queue of events processed by that Expert Advisor.


https://www.mql5.com/ru/docs/runtime/running

All events generated by client terminal stack up in the common queue. Thus the events are processed one after another in the order they are received. The only exception is NewTick event. If there is already an event in the queue or if the event is being processed, a new NewTick event is not placed in the queue.

The event queue has a limited size. When the queue becomes full, old events are removed without being processed to make room for new events. This is why it is highly recommended to write efficient event handlers and not to use infinite loops (except for scripts that handle a single Start event).

Документация по MQL5: Программы MQL5 / Выполнение программ
Документация по MQL5: Программы MQL5 / Выполнение программ
  • www.mql5.com
Программы MQL5 / Выполнение программ - Документация по MQL5
 
Rosh:

https://www.mql5.com/ru/docs/runtime/running

The client terminal stores all occurring events in a common queue. In this way, the events are processed one after the other in the order they are received. The exception is the NewTick event. If there is already an event in the queue or if the event is being processed, a new NewTick event is not placed in the queue.

The event queue has a limited size. When the queue becomes full, old events are removed without being processed to make room for new events. For this reason it is highly recommended to write efficient event handlers and not to use infinite loops (the exception is scripts that handle a single Start event).

Thus, the rule "one NewTick event for the whole common queue" is always valid, regardless of presence/absence of OnTick() function in the EA. Thanks for clarification!

There is still a question about switching off unnecessary tick generation process in the tester.

 

Yedelkin:

The question remains about disabling the process of generating unnecessary ticks in the tester.

Don't process them there and logically everything will be OK.

 
Interesting:

Don't process them there and logically everything will be OK.

It's only at first glance " everything will be OK". I assume that the ticks in the tester are generated forcibly, over the entire testing/optimisation period. Do you agree? If so, the ticks will be forcedly generated for the symbol, to which the Expert Advisor is attached, and which (ticks) are not processed by that EA. I.e., despite the absence of ticks processing for this symbol (your proposal), the tester will waste its time on ticks generation. If there is something I do not understand, I am ready to learn new things with pleasure.

 
Yedelkin:

Well, I'll say it again: the Expert Advisor does not work with the symbol to which it is attached at all. And he does not need to track any SL and TP on this symbol. I.e., the Expert Advisor does not need ticks on this symbol. EA is attached to the symbol only as required, because it needs to be attached at least somewhere to run.

Ahem... And why should you test the Expert Advisor on a symbol you are not trading on? Test on the one you need to trade on.

And if you don't need to trade at all, then you don't need to test either - work with the quote history from the real-time running EA.

 
Rosh:

The client terminal stores all occurring events in a common queue. In this way, the events are processed one after the other in the order they are received.

Rashid, what happens to the events that are not handled by the EA/script/indicator? That's what the question was about.

Are they really put in the queue and only removed from it when processing of the event to which the response is intended is activated?

Or was I still right in assuming that everyone has their own queue, and only the events that need to be processed are collected there?

Документация по MQL5: Основы языка / Функции / Функции обработки событий
Документация по MQL5: Основы языка / Функции / Функции обработки событий
  • www.mql5.com
Основы языка / Функции / Функции обработки событий - Документация по MQL5
 
Yedelkin:

It's only at first glance "everything will be OK". I assume that the ticks in the tester are generated forcibly, for the entire testing/optimisation period. Do you agree? If so, the ticks will be forcedly generated for the symbol, to which the EA is attached, and which (ticks) are not processed by this EA. I.e., despite the absence of processing of ticks for this symbol (your suggestion), the tester will waste its time generating them. If there is something I do not understand, I will be glad to learn new things.

Let's speak for the "All ticks" mode.

I understand that they are not just forcibly generated, and all symbols selected and traded in the Expert Advisor (no way without it).

Ticks on the selected symbol in the tester settings (main symbol) may be handled in OnTick or not (in this case, if this type of event is already handled or exists in the queue, it is not added to it).

At least, this is how I understood the developer's logic.

3.Based on the task you have described, we get information about the ticks on the additional symbols with the custom events, relating to the ChartEvent. The ChartEvent gets to the queue and will be executed or deleted when it is full.

It is clear from the above mentioned that if the processing of ticks from "additional symbols" (external to Expert Advisor) is performed ineffectively, it is the ChartEvent processing that will be a problem and will litter the whole event queue stack.

I may not fully understand the logic of your Expert Advisor, but in these conditions, I would put in a timer a block to collect information about prices of all symbols and other important information about additional symbols. And using ChartEvent I would transfer only information about appearing of, say, a new bar.

You can also process information about other symbols in the OnTick block (if it is used), as it is done in MT4. But the timer has some advantage here, because the timer is processed periodically and not more than once per second.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Типы событий графика
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы графиков / Типы событий графика
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы графиков / Типы событий графика - Документация по MQL5
 
komposter:

Rashid, what happens to events that are not handled by the EA/script/indicator? That was the question, wasn't it?

Are they really put in a queue and only removed from it when the processing of the event to which the response is intended is activated?

Or was I still right in assuming that everyone has their own queue, and only the events that need to be processed are collected there?

As far as I understand, if there is no processing, the events in the queue are "dropped" from it when a new event arrives (if the queue is full).
 
komposter:

Rashid, what happens to events that are not handled by the EA/script/indicator? That was the question, wasn't it?

Are they really put in a queue and only removed from it when the event processing to which the response is provided is enabled?

Or was I still right, assuming that each queue has its own, and only the events that need to be processed are collected there?

Answer of the developers:

Every Expert Advisor/Script/indicator has its own queue. Of course, nothing in the queue is frozen if the handler is not available. Well, if there isn't one, it's read out and skipped.

 
komposter:

Ahem... Why would you test an EA on an instrument you're not trading?

You probably haven't read my posts very carefully, which have already laid out the working principle. I suggest ending the subject at this point.

I want to explain why I did it, but in any case, thanks, I learned a lot with your help.

Reason: