Fail to load a custom indicator (error message: cannot load custom indicator 'xx/xxx'[4802])

 

hi all, 

I am very new to mql5, but I have some knowledge in programming (Python).

Currently I am trying to create a EA to read from a custom indicator, thus I wrote a simple code below to check if I can retrieve the information with icustom:

 int handle1;

 handle1=iCustom(Symbol(),0,"jon/indicator1",22,3.0,22);
 if(handle1==INVALID_HANDLE)
 return(INIT_FAILED);

 double testbuffer[];

 CopyBuffer(handle1,0,1,1,testbuffer);
 Print(testbuffer[0]);
 Print(testbuffer[1]);


But I have received the following error message: cannot load custom indicator ' jon/indicator1 '[4802].

FYI I have done complied the "indicator1" .ex5 file , which I received from someone else.

Can anyone giving me some hints on how to correct it?

Much appreciate it!

Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • 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.
 

This is error codes here on this page: https://www.mql5.com/en/docs/constants/errorswarnings/errorcodes

ERR_INDICATOR_CANNOT_CREATE

4802

Indicator cannot be created


And it is one post about it (the thread with one post):

Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Runtime Errors
Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Runtime Errors
  • www.mql5.com
Runtime Errors - Codes of Errors and Warnings - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Ismale.d:

hi all, 

I am very new to mql5...

Hi and welcome here :)

But:

  1.  Please if you post code use the code button (Alt+S= or the icon </>.
  2. If something is not working put the cursor on the MQL5 function and press F1.
  3. I am using the page: https://www.mql5.com/en/docs/function_indices to search for keywords if e.g. I have forgotten the function for a certain thing.
  4. The ref for iCustom says:
    If the path to the indicator is set in the subdirectory (for example, MyIndicators\ThirdIndicator), the search is first performed in the calling program folder (the EA is located in MQL5\Experts\MyExperts) in MQL5\Experts\MyExperts\MyIndicators\ThirdIndicator.ex5. If unsuccessful, the search for the MQL5\Indicators\MyIndicators\ThirdIndicator.ex5 file is performed. Make sure to use the double reverse slash '\\' as a separator in the path, for example iCustom(Symbol(), Period(), "MyIndicators\\ThirdIndicator"...)

So you need to check the path in your call of iCustom.

Good luck :)

Documentation on MQL5: List of MQL5 Functions
Documentation on MQL5: List of MQL5 Functions
  • www.mql5.com
List of MQL5 Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Sergey Golubev #:

This is error codes here on this page: https://www.mql5.com/en/docs/constants/errorswarnings/errorcodes

ERR_INDICATOR_CANNOT_CREATE

4802

Indicator cannot be created


And it is one post about it (the thread with one post):

Much appreciate the quick reply, but I have another similar code (which assign iRsi to a handle) in this same EA (actually this EA only has icustom and the iRsi ones for testing purpose ) that run properly, so it shouldn't be the file being corrupted. 

I wonder if there is anything wrong with the code I posted? Or that I need to do something in the custom indicator in order to use icustom to call it. 

Anyway thanks for help!

 
Carl Schreiber #:

Hi and welcome here :)

But:

  1.  Please if you post code use the code button (Alt+S= or the icon </>.
  2. If something is not working put the cursor on the MQL5 function and press F1.
  3. I am using the page: https://www.mql5.com/en/docs/function_indices to search for keywords if e.g. I have forgotten the function for a certain thing.
  4. The ref for iCustom says:

So you need to check the path in your call of iCustom.

Good luck :)

Thanks for the heads up! I revised accordingly. 

I read the content in https://www.mql5.com/en/docs/indicators/icustom, but I am not sure I understand fully what mentioned inside. 
The path is correct as another EA is able to call another custom indicator, so I wonder may be there is something needed to be done on "indicator1" before I can call it? And may I know if the code I listed is correct?

Thanks!

Documentation on MQL5: List of MQL5 Functions
Documentation on MQL5: List of MQL5 Functions
  • www.mql5.com
List of MQL5 Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Hello, I'm having issues after loading a Ea to the FILE - MQL5 - experts - I get the error cannot load custom indicator  [4802] can anyone help with this?

 
 int handle1;

 handle1=iCustom(Symbol(),0,"jon/indicator1",22,3.0,22);
 if(handle1==INVALID_HANDLE)
 return(INIT_FAILED);

 double testbuffer[];
 ArraySetAsSeries(testbuffer, true);
 CopyBuffer(handle1,0,1,2,testbuffer);
 Print(testbuffer[0]);
 Print(testbuffer[1]);
I think you should study CopyBuffer documentation closely.
Reason: