Subscription to OnBookEvent sometimes falls off - is there such a thing? - page 14

 
fxsaber:

I can't get it to delete.

How about closing all the charts?

 
Andrey Barinov:

what if all the charts were closed?

It wouldn't help, of course.

 
Stanislav Korotky:

According to the response from service-desk, the counter is supposed to be the same for the whole chart (each symbol is different), and each MQL-developer has to rely on the fact that other MQL-developers will not make a mistake when decreasing the counter in the same chart. Explanations will be added to the help.

"Saving the drowning is a matter of the drowning."

Service Desk's answer was a bit different. And the request to Service Desk did not refer to any counters.

Nevertheless, the counter handling will be fixed in the next builds. Exactly as I wrote earlier.

Subscribing adds to the meter, unsubscribing adds to the meter. The counter is within the schedule. For each tool (you can subscribe to any tool), it has its own counter. This counter counts subscriptions to any instruments that originate from the programmes attached to the given chart. When the chart is closed, all remaining non-zero counters will be unsubscribed.

 
Slava:

Service Desk's reply was a bit different. And the request to servicedesk did not concern any counters.

However, in future builds the counter operation will be corrected. Exactly as I wrote earlier.

Subscribing adds a counter, unsubscribing adds a counter. The counter is within the schedule. For each tool (you can subscribe to any tool), it has its own counter. This counter counts subscriptions to any instruments that originate from the programmes attached to the given chart. When the chart is closed, all remaining non-zero counters will be unsubscribed.

You've repeated what the service desk said. The point is that there is no guarantee of saving subscription from a valid MQL program, which has subscribed once and hasn't unsubscribed, but there is an alien MQL program that will unsubscribe. Since the counter is for the chart and not for the program. At least it sounds that way.

 
fxsaber:

And if an invisible indicator has "accidentally" been triggered (I'm sure there are some in the Marketplace)... Until you restart the Terminal, you'll still have to fuss about it to no avail.

With the arrival of Services even more urgent.

I've been writing a proposal for an analogue of the CPU Manager (scripts) in the SD for a long time now.

 

So as not to be unsubstantiated, here is a quote from a new (forthcoming) reference:

Начальное значение счетчика подписок равно нулю. При каждом вызове MarketBookAdd() счетчик подписок для указанного символа на данном графике увеличивается на единицу (символ графика и символ в MarketBookAdd() не обязаны совпадать). При вызове MarketBookRelease() счетчик подписок на указанный символ в пределах графика уменьшается на единицу. Трансляция событий BookEvent по любому символу в пределах графика продолжается до тех пор, пока счетчик подписок по данному символу не станет равным нулю. Поэтому важно, чтобы каждая MQL5-программа, которая содержит вызовы MarketBookAdd(), при завершении своей работы правильно отписывалась от получения событий по каждому использованному символу с помощью MarketBookRelease(). Для этого достаточно, чтобы количество вызовов MarketBookAdd() и  MarketBookRelease() по каждому вызову было четным за всё время жизни MQL5-программы. Использолвание флагов или собственных счетчиков подписок внутри программы позволяет безопасно работать с событиями BookEvent и предотвращает отключение подписок на получение этого события в чужих программах в пределах одного графика.

If new behavioural fixes are supposed to be made, how would this fragment sound? The yellow highlighted recommendation, compliance with which cannot be traced in other people's programs and a potential source of errors.

 
Slava:

Service Desk reply was a bit about other things. Yes and request to servicedesk did not touch any counters.

However, in future builds the counter operation will be corrected. Exactly as I wrote before.

Subscribing adds a counter, unsubscribing adds a counter. The counter is within the schedule. For each tool (you can subscribe to any tool), it has its own counter. This counter counts subscriptions to any instruments that originate from the programmes attached to the given chart. When the chart is closed, all remaining non-zero counters will be unsubscribed.

Very much waiting for new build (a lot of bugs accumulated).

Reason: