Errors, bugs, questions - page 1669

You are missing trading opportunities:
- Free trading apps
- Free Forex VPS for 24 hours
- 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
Does MQ5 program always automatically perform IndicatorRelease of all handles that it created after the execution is finished?
Or is it possible to run the indicator via IndicatorCreate by a script, then pass its handle through global variables for further work with the indicator?
https://www.mql5.com/ru/docs/basis/preprosessor/compilation
Constant
Type
Description
tester_indicator
string
Name of the custom indicator in the "indicator_name.ex5"format.Indicators necessary for testing are determined automatically fromiCustom() function call, if the corresponding parameter is specified as a constant string. For other cases (use of theIndicatorCreate() function or use of a non-constant string in the parameter specifying the indicator name) this property should be
IndicatorCreate - almost (no restrictions on the number of input parameters) rudiment?
What's the meter?
If you try to create a code that will contain IndicatorRelease, but won't call the indicator itself, you won't compile it, because you have to pass a handle to IndicatorRelease, but if you don't call indicator from program, you won't get handle.
BlackTomcat:
Вчера обсуждали, страница 1687. :) Но читать лучше вот с этого сообщения на 1686-й странице: https://www.mql5.com/ru/forum/1111/page1686#comment_2790746 Кстати, человек на Ваш же вопрос отвечал. Просто получается, что схема такая. Запрос на вызов индикатора попадает в Терминал. Т.е. советник или скрипт не вызывают индикатор напрямую, терминал выступает посредником. В терминале происходит проверка, существует ли уже такой индикатор с указанными параметрами. Если да, то он возвращает программе, вызвавшей индикатор, хэндл (ссылку) на уже существующий индикатор. А в своих терминальных недрах помечает в счётчике, что был ещё один вызов на данный индикатор. Т.е. он ведёт учёт, сколько хэндлов на данный индикатор вернул. Когда кто-то делает IndicatorRelease, это не значит, что остальным, кто вызвал этот же индикатор с такими же параметрами, этот индикатор больше не нужен. Поэтому Терминал уменьшает счётчик на единицу, но оставляет индикатор активным, потому-что им ещё кто-то пользуется.
Thank you! This turns out to be a great saving.
If you try to create code, which will contain IndicatorRelease, but will not contain call of the indicator itself, I think, you won't compile it, because you will need to pass the handle to IndicatorRelease, and if the indicator hasn't been called from the program, you won't get the handle.
I can pass the handle through global variables. Therefore, it is quite possible to use it.And you do not. :) Or at least do not call IndicatorRelease() for a handle obtained this way. If you do so, it will be your error, but not a bug of the language, do you agree?
And I'll write a bad tab for the free Market, which at a certain point will just go through the whole positive int range and try IndicatorRelease for each.
Such a script will cover all the Expert Advisors and indicators of the terminal that used iCustom without ChartIndicatorAdd.
Again, that would be your deliberate action, not a language bug. Why did you write that?
By the way, this conversation started with your question about how to check the indicator handle before using it. Well, you can't check it, but at an attempt to use a handle of a closed indicator, you will get error 4807 - well, you should check it after each call of CopyBuffer(), if it returns -1.
I can pass the handle through global variables. So it's quite possible to use it.
Execution error: 'invalid pointer access' (*)