iCustom() don't work properly

 

Hi everyone,

I have downloading some indicators for testing it in a EA, and I could not get him to paint the indicator. The indicator data when debugging is correct, and there is no error loading it. The problem is that most of the time the indicator is not visible, even if the data is being generated correctly. I have tried everything that has occurred to me and nothing...

Things I have tried:

  • Rename indicator's name (without any special character)
  • Different periods
  • Reloading the indicator in each tick (this works but because I load many indicators. In a few seconds debugger becomes so slow)

This is my example code:

int maDefinition;

// Expert initialization function
int OnInit() {
   loadIndicator();
   
   Print("Indicator handle -> ", maDefinition);
   
   return(INIT_SUCCEEDED);
}

void OnTick() {
   //loadIndicator();

   double openPrices[1];
   CopyBuffer(maDefinition, 0, 0, 1, openPrices);
   double openPrice = NormalizeDouble(openPrices[0], 5);

   Print("Last open price -> ", openPrice);
}

void loadIndicator() {
   
   maDefinition = iCustom(
      Symbol(),
      Period(),
      "MT5 Traders/4_ma_candles.ex5",  // I have the indicator in "MT5 Traders" folder
      25,  // Averages Period
      MODE_EMA  // Average Method -> ENUM_MA_METHOD
   );
}

Thanks a lot


PD: Sorry for that coding style, I am fullstack web developer.

<ex5 file deleted>

 
The first thing you must do is Check your return codes for errors, and report them including GLE/LE. Don't look at it unless you have an error. Don't just silence the compiler, it is trying to help you. iCustom and CopyBuffer
          What are Function return values ? How do I use them ? - MQL4 programming forum
          Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
 
William Roeder:
The first thing you must do is Check your return codes for errors, and report them including GLE/LE. Don't look at it unless you have an error. Don't just silence the compiler, it is trying to help you. iCustom and CopyBuffer
          What are Function return values ? How do I use them ? - MQL4 programming forum
          Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
I am receiving code 0 with GetLastError(), which corresponds to ERR_SUCCESS, so I have no error when I load the indicator, any more ideas?
Files:
Log.png  48 kb
 
ivanzhen: I am receiving code 0 with GetLastError(), which corresponds to  ERR_SUCCESS, so I have no error when I load the indicator, any more ideas?

The second call?

 
ivanzhen:
I am receiving code 0 with GetLastError(), which corresponds to ERR_SUCCESS, so I have no error when I load the indicator, any more ideas?
There are iCustom inputs missing. Where is Shift? The wrong number of parameters for that specific indicator. Usually wrong number of parameters does not give error but malfunctions
Reason: