Indicator error when loaded

 

Hi,

I get a bug regarding loading indicator on Metatrader 5.

If my indicator is located on "Examples" repertory, that works fine :

   param[0].type=TYPE_STRING;
   param[0].string_value = "Examples\\MyIndic.ex5";
   ...
   handle = IndicatorCreate(Symbol(),Period(),IND_CUSTOM,nb_params,param);


But if I move my indicator directly on "Indicators", the following code doesn't work :

   param[0].type=TYPE_STRING;
   param[0].string_value = "MyIndic.ex5";
   ...
   handle = IndicatorCreate(Symbol(),Period(),IND_CUSTOM,nb_params,param);


I have a 4802 error returned...


Any idea ?

 

I haven’t been using IndicatorCreate for a long time. Instead, I use "iCustom".

Here is what your example will look like (if directly on "Indicators")

   //--- create handle of the indicator iCustom
      handle_iCustom=iCustom(Symbol(),Period(),"MyIndic");
   //--- if the handle is not created
      if(handle_iCustom==INVALID_HANDLE)
        {
         //--- tell about the failure and output the error code
         PrintFormat("Failed to create handle of the iCustom indicator for the symbol %s/%s, error code %d",
                     Symbol(),
                     EnumToString(Period()),
                     GetLastError());
         //--- the indicator is stopped early
         return(INIT_FAILED);
        }
 

Hi,

I've founded my problem...

Metatrader shall be restarted in order to access new locations of indicators.

Thx,

 
Erwann Pannerec:

Hi,

I've founded my problem...

Metatrader shall be restarted in order to access new locations of indicators.

Thx,

When you move an indicator "manually", you can also update MT5 with Refresh command in the Navigator.


 

Oh Yes, It's working too :)

Thx !

Reason: