How can I return error code from my custom indicator?

 

Hi,

I have a custom indicator ('A') that is called only by iCustom function from my another custom indicator('B').

In OnInit function of indicator 'A', I always check some requirements and if it is not OK, I will return INIT_FAILED.

When I call indicator 'A' by iCustom function, it always return valid handle value. How I can I recognize that indicator 'A' failed to init?

Thanks for reading and response.

 

rbigdelis:

When I call indicator 'A' by iCustom function, it always return valid handle value. How I can I recognize that indicator 'A' failed to init?


https://www.mql5.com/en/docs/globals

Set a global variable in indicator 'A' that is read by indicator 'B'.

 
Anthony Garot:

https://www.mql5.com/en/docs/globals

Set a global variable in indicator 'A' that is read by indicator 'B'.

It is good idea and works.
Thank you very much.
 
rbigdelis: I have a custom indicator ('A') that is called only by iCustom function from my another custom indicator('B').

In OnInit function of indicator 'A', I always check some requirements and if it is not OK, I will return INIT_FAILED.

Why are you passing invalid "requirements" from B?

Reason: