Is it me or is the indicator I am using not working correctly?

 

Hello world

So I am using the iCustom function with an Heiken Ashi indicator I got on the market. I keep getting the error for incorrect input parameters [4002]. 

input group "Heiken Indicator inputs"
input int heikenPeriod = 10;
input ENUM_MA_METHOD MaMethod = MODE_EMA;
input color uptrendColor = clrPaleTurquoise;
input color downtrendColor = clrLightPink;
input bool plotInBackground = false;
input bool pushNotifications = false;
input bool alerts = false;

input group "Money Managment"
input int slPoints = 50;
input double risk = 1.0;

int handleHeiken;
int barsTotal = 0;
double heikenClose[], heikenOpen[], heikenHigh[],heikenLow[];


int OnInit(){
   
   handleHeiken = iCustom(_Symbol,PERIOD_CURRENT,"Market\\Smoothed HeikenAshi MT5.ex5",heikenPeriod,MaMethod,uptrendColor,downtrendColor,plotInBackground,pushNotifications,alerts);
   
   return(INIT_SUCCEEDED);
}
void OnDeinit(const int reason){
   
   
}
void OnTick(){
   int bars = iBars(_Symbol,PERIOD_CURRENT);
   if(barsTotal != bars){
      barsTotal = bars;
      
      //CopyBuffer(handleHeiken,0,1,5,heikenOpen);
      //CopyBuffer(handleHeiken,1,1,5,heikenHigh);
      //CopyBuffer(handleHeiken,2,1,5,heikenLow);
      //CopyBuffer(handleHeiken,3,1,5,heikenClose);
      
   }
   
}


and if I just attach the indicator with these inputs...




the indicator works just fine.

So am I misunderstanding something? Any advise would be appreciated.

An Example of a Trading System Based on a Heiken-Ashi Indicator
An Example of a Trading System Based on a Heiken-Ashi Indicator
  • www.mql5.com
In this article we look into the question of using a Heiken-Ashi indicator in trading. Based on this indicator, a simple trading system is considered and an MQL5 Expert Advisor is written. Trading operations are implemented on the bases of classes of the Standard class library. The testing results of the reviewed trading strategy, are based on the history, and obtained using the built-in MetaTrader 5 strategy tester, are provided in the article.
 

Please note that the discussion of Market products is against forum rules.

However, given that this is a coding question and the product in question is currently free, it will be allowed.

Please be warned not to stray into discussing the product any further, or else this entire thread will be removed.

Stick to discussing the coding aspects.

 
Louis Fourie: So I am using the iCustom function with an Heiken Ashi indicator I got on the market. I keep getting the error for incorrect input parameters [4002]. and if I just attach the indicator with these inputs... the indicator works just fine. So am I misunderstanding something? Any advise would be appreciated.

In response to your query, please note that the Indicator in question as two extra parameters.

I am referring to the "string" parameters name something like "===============================". Those parameters are actually a bad coding practice by the author from the MQL4 era, and should have been replaced by "input groups" in MQL5, and not "string inputs".

However, that been said, that is how it was done, so you have to compensate for it as follows ...

handleHeiken = iCustom( _Symbol, _Period, "Market\\Smoothed HeikenAshi MT5.ex5", "", heikenPeriod, MaMethod,
   uptrendColor, downtrendColor, plotInBackground, "", pushNotifications, alerts );

In other words, I've added empty strings "", at the relevant positions.

Please note that I did not test the code and the example above only serve to explain the issue.

 
Fernando Carreiro #:

In response to your query, please pay attention that the Indicator questions as two extra parameters.

I am referring to the "string" parameters "===============================". Those parameters are actually a bad coding practice by the author and should have been "input groups" and not "string inputs".

However, that been said, that is how it was done, so you have to compensate for it as follows ...

In other words, I've added empty strings "", at the relevant positions.

Please note that I did not test the code and the example above only serve to explain the issue.

Thank you very much. This was really frustrating me.