Error 4802 ??

 
Has anyone recently encountered again this error: Err[4802] ERR_INDICATOR_CANNOT_CREATE: Indicator cannot be created
and would be able to give a hint how to defeat it?

I have built an indicator that runs on all symbols and timeframes since quite a while! But now when I want to load it in OnInit() in my EA the
error 4802 appears, unfortunately without any hint where to start to do something about it :(

I (Win 10, MT5, b.3580) have checked, deleted and again wrote the indicator under a new name in \MQL5\Indicators\ (where two others are saved and loaded by my EA without problem).

My indicator does not have/need resources nor other indicators with the same or different timeframes.

The EA runs in the same timeframe as the indicator.

I have read https://www.mql5.com/en/forum/357491 where he deleted the project file - I have no project just my indicator(s) in \MQL5\Indicators\ and the EA in \MQL5\Experts\
iCustom getting error 4802 with perfectly fine indicator, with solution
iCustom getting error 4802 with perfectly fine indicator, with solution
  • 2020.12.08
  • www.mql5.com
Hi, this is my report on a problem that started to happen with me some days ago and also the solution I found...
 
Carl Schreiber:
Has anyone recently encountered again this error: Err[4802] ERR_INDICATOR_CANNOT_CREATE: Indicator cannot be created
and would be able to give a hint how to defeat it?

I have built an indicator that runs on all symbols and timeframes since quite a while! But now when I want to load it in OnInit() in my EA the
error 4802 appears, unfortunately without any hint where to start to do something about it :(

I (Win 10, MT5, b.3580) have checked, deleted and again wrote the indicator under a new name in \MQL5\Indicators\ (where two others are saved and loaded by my EA without problem).

My indicator does not have/need resources nor other indicators with the same or different timeframes.

The EA runs in the same timeframe as the indicator.

I have read https://www.mql5.com/en/forum/357491 where he deleted the project file - I have no project just my indicator(s) in \MQL5\Indicators\ and the EA in \MQL5\Experts\

I havenot encountered it , but ,the first thing i would try is move the creation on timer , then kill the timer . 

 
Lorentzos Roussos #:

I havenot encountered it , but ,the first thing i would try is move the creation on timer , then kill the timer . 

I don't use a timer, just normal indicators and a normal, simple EA
 
Carl Schreiber #:
I don't use a timer, just normal indicators and a normal, simple EA

Yeah but it you can test it , or on tick , have a first load function . Probably not it but you can test it

 

A timer - where? In the EA or in the indicator?

Here it fails:

int OnInit()
  {

//...

   hIndi = iCustom(_Symbol,PERIOD_H1,"Indi");
   if (hIndi == INVALID_HANDLE) {
      Print("Handle Indi failed, err:",err());
      return(INIT_FAILED);
   }

//...

}
 
Carl Schreiber #:

A timer - where? In the EA or in the indicator?

Here it fails:

I get 4802 as well .

Try indi.ex5

It works without the extention here too , on init . That means the file is not there or you are reading the wrong folder

int hIndi=INVALID_HANDLE;
int OnInit()
  {
//---
     hIndi = iCustom(_Symbol,PERIOD_H1,"forum\\custom_ema_on_array");
   if (hIndi == INVALID_HANDLE) {
      Print("Handle Indi failed, err:",GetLastError());
      return(INIT_FAILED);
   }else{
   Print("Yay");
   }
//---
   return(INIT_SUCCEEDED);
  }
 
Whooo!?
You're right with "Indi.ex5" it works, and the next indicator I call without ex5 (only the name)?
And now tell me that computers are lifeless machines without their own quirks and spleens.
 
Carl Schreiber #:
Whooo!?
You're right with "Indi.ex5" it works, and the next indicator I call without ex5 (only the name)?
And now tell me that computers are lifeless machines without their own quirks and spleens.

Ehehe 🤣 , well what is different on that indicator ? 

 
I have written both, both are located in the directory ..\Indicators\, both are called by iCustom(_Symbol,PERIOD_H1, ...) -  one (3 char name) needs ".ex5" the other (14 char) doesn't.
 
Carl Schreiber #: I have written both, both are located in the directory ..\Indicators\, both are called by iCustom(_Symbol,PERIOD_H1, ...) -  one (3 char name) needs ".ex5" the other (14 char) doesn't.
Maybe the length of the name is the key factor, requiring a minimum length.
 

There also seems to be a maximum length.

Forum on trading, automated trading systems and testing trading strategies

Getting error 4802 when loading custom indicator that loads another custom indicator with iCustom

Martin Bittencourt, 2020.07.26 07:24

Hi,

for the record, I figured out my previous solution was actually incorret. Now I was doing a similar stuff with another indicator (i.e. creating an EA that used a custom indicator which called for another custom indicator) and I got exactly the same problem I had with the case of this thread - but now, there was anything 'problematic' with the file path using spaces or special symbols.

Then, upon better inspection, I noticed the problem was just too big filepath: the name of indicator was being cut. So I shrinked the indicator's name and everything started working.

So, the correct solution is: don't use too big filepaths for your indicators =)


Reason: