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

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
There is one crutch solution.
Use the global variables of the TERMINAL to create your own counter.
Only you need to think of a unique name so that two windows of the same symbol create their own
global terminal variable.
Added
If you do not want to open two symbol windows, you can use Magik as the name of the global terminal variable
you can use Magik
or just a symbol name
such as "Si-9.18_bookcount".
I count collateral (GO) funds for pending orders this way
Only you need to think of a unique name so that two windows of the same symbol create their own global terminal variable.
I can hardly think of a better name than this https://www.mql5.com/ru/forum/267154/page8#comment_8171650
Great, whatever the name, as long as it's unique if there's more than one window
Added
Correct me if I've got it wrong somewhere.
Correct, if I've got it wrong somewhere
The uniqueness of the name is directly related to the name of the symbol, I meant the more general case
i.e. in your case (if all MQL programs on the chart work only with the current symbol)
instead of
it's not a mistake... just disciplineGuys!
We will NEVER "beat" MT-5!
Indicator 1
Indicator 2
Global Variables
Result 1
Result 2
If you put 1 indicator and then the second indicator, then
when you remove the 1st indicator - total rubbish (Result 2), BUT
If you put the 1st indicator first and then the 2nd indicator and then
remove 2nd, then 1st, everything is fine (Result 1)!
Added
It seems that if 2 indicators are added, then when removing the indicator that
was placed first,
void OnDeinit(const int reason) is called as many times as there are indicators on the chart!
Guys!
We will NEVER "beat" the MT-5!
In general, there are pitfalls when dealing with global variables... there may be a mistake in the code... I'm on my mobile right now - maybe someone from my computer can check it - help me
I think I've got it! Every indicator has a variable that needs to be updated before it can be deleted! :)
I'll fix it.
Yes, my mistake. It's working properly.
Attached file
Indicator
It's working properly!
Take advantage of it.
This doesn't help in the general case where the software is from different vendors and there is no control in common. So all this tambourine dancing is initially useless. And this has already been said before. You are cluttering up the thread off-topic.