Download MetaTrader 5

Initialization of indicators from EA

To add comments, please log in or register
MQL5.community allows users to store their source codes in MQL5 Storage. Try it!
graziani
1955
graziani 2013.06.24 17:30 

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.
Alain Verleyen
Moderator
30742
Alain Verleyen 2013.06.24 19:35  
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.
To add comments, please log in or register