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

 

Hi,

I have an indicator called  DCBA . It works fine when I put it on a graph as well as when I call it with iCustom in my EA.

From it, I created another indicator which loads DCBA. In the call in OnInit, nothing special:

   glHandleDCBA1 = iCustom(_Symbol,DCBAPeriod1,"::Indicators\\Martinware\\DCBA\\MW DCBA.ex5"
         ,"",20,"",false);
   
   if (glHandleDCBA1 == INVALID_HANDLE)
   {
      Alert("Error loading MW DCBA 1 (error: ",GetLastError(),")");
      
      return INIT_FAILED;
   }

When I load this indicator in a graph, it works fine. But now, when I try to load it from within my EA using iCustom, I get error 4802. I did some research on the forum about this problem and the only possible solution I found was to add

#property tester_indicator "MW DCBA.ex5"

on it, but it didn't solve my problem :/ 

So, how to make my new indicator load DCBA properly when called with iCustom? Why in this case it gets an error, but when I attach it on a graph, everything works fine? Any help will be appreciated!


 

What for

::Indicators

?

Are you working with resources? Why don't you talk about it?

 
Vladimir Karputov:

What for

?

Are you working with resources? Why don't you talk about it?

Oh, I didn't see any reason to comment on that. Any way, I always include my indicators as resources :)

#resource "\\Indicators\\Martinware\\DCBA\\MW DCBA.ex5"

Is that wrong? :| I mean, it always worked and, giving the concept of resources, it made sense to always do that :)

EDIT: Btw, the manual files themselves talk about putting indicators as resources, what "simplifies the distribution of programs".
 
Any ideas? :(
 
Martin Bittencourt: Oh, I didn't see any reason to comment on that.

     How To Ask Questions The Smart Way. 2004
          Be precise and informative about your problem

You call your indicator as a resource. But does that indicator have its resource?

 
William Roeder:

     How To Ask Questions The Smart Way. 2004
          Be precise and informative about your problem

You call your indicator as a resource. But does that indicator have its resource?

Hi,

I'm not so sure what you mean. The DCBA indicator, the one being called with iCustom, has resources included (audio files). But I suppose this shouldn't affect in anything, after all, once compiled, the resource becomes part of the .ex5, so when iCustom calls it, it is already calling for a complete, fully functional file with its own resources included. Remembering: DCBA works fine on its own both when attached to a graph as well as when called by iCustom in an EA.

Regarding your links, I can't see why should I have mentioned that. After all, I've been calling indicators as resources since forever and I never got problems with that. Moreoever, to do so its a viable method included in MT5's help files, so I would have never assumed the problem would have anything to do with a million-times 'used and ok' system.

 
Well, I got it! 

I was investigating once again what could be wrong and I noticed that, when I was calling the indicator that loads DCBA from within my EA, I was doing something I don't remember to have ever done: using a file phath that not only included special symbols, but space:

iCustom(_Symbol,
         TFMain,
         "::Indicators\\Martinware\\- Unfinished\\MW My Indicator.ex5",
                                
         etc
        );

And while the project was compiling fine and the indicator was being correctly added to the resources, the iCustom function itself doesn't seem to like 'strange paths'. Sad thing there is nothing about this problem in the iCustom documentation and, to make things worst, even though the caller indicator was the one with the problematic path, it was one of its internal iCustom functions that were giving problem, not the indicator itself.

So, solution: whenever calling anything with iCustom, only use good file paths.
 
Martin Bittencourt:
Well, I got it! 

I was investigating once again what could be wrong and I noticed that, when I was calling the indicator that loads DCBA from within my EA, I was doing something I don't remember to have ever done: using a file phath that not only included special symbols, but space:


And while the project was compiling fine and the indicator was being correctly added to the resources, the iCustom function itself doesn't seem to like 'strange paths'. Sad thing there is nothing about this problem in the iCustom documentation and, to make things worst, even though the caller indicator was the one with the problematic path, it was one of its internal iCustom functions that were giving problem, not the indicator itself.

So, solution: whenever calling anything with iCustom, only use good file paths.

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 =)