How can I return error code from my custom indicator?

To add comments, please log in or register
rbigdelis
29
rbigdelis  

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.

Anthony Garot
1819
Anthony Garot  

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'.

rbigdelis
29
rbigdelis  
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.
whroeder1
17949
whroeder1  
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?

To add comments, please log in or register