Initialization of indicators from EA

 

If you call a custom indicator from EA, is there a way to know if the indicator initialized successfully?

In my experience, iCustom() always returns  valid handle, regardless of result of custom indicators OnInit().

This is also valid for putting custom indicator on chart:
initialization fails, DeInit() is executed, but indicator still exists in Indicator list.

Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • 2009.11.23
  • Андрей
  • www.mql5.com
I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.
 
graziani:

If you call a custom indicator from EA, is there a way to know if the indicator initialized successfully?

In my experience, iCustom() always returns  valid handle, regardless of result of custom indicators OnInit().

This is also valid for putting custom indicator on chart:
initialization fails, DeInit() is executed, but indicator still exists in Indicator list.

Good catch, I was not aware of this problem. There is a bug in mql5 here.
Reason: