indicator inputs resulting in slow backtest

 

Hi guys I have this indicator that I want to use in my EA. This indicator have a lots of alert in the setting and when I backtest the EA it will popped up on the journal tab. I want to turn off all the alerts but when I used false on the input tab it will result in a slow backtest. Is there a way to turn off the alert without affecting the backtest speed?

<ex4 file removed>

//below result in normal backtest
double QQEUp(int shift=0)
{
   return iCustom(Symbol(),PERIOD_CURRENT,"qqe-indicator",5,8,8.0,60.0,40.0,3,shift);
}

//below will result in slow backtest
double QQE(int shift=0)
{
   return iCustom(Symbol(),PERIOD_CURRENT,"qqe-indicator",5,8,8.0,60.0,40.0,false,false,false,false,false,false,false,false,3,shift);
}
 
Paul Anscombe #: you have a different number of inputs for the same indicator how is that supposed to work!

iCustom() function allows for latter parameters to be skipped and assume default values set by the Indicator. That's why both versions in the OP's code will work correctly as he has pointed out.

 
Luandre Ezra: Hi guys I have this indicator that I want to use in my EA. This indicator have a lots of alert in the setting and when I backtest the EA it will popped up on the journal tab. I want to turn off all the alerts but when I used false on the input tab it will result in a slow backtest. Is there a way to turn off the alert without affecting the backtest speed?

The Indicator code problem has a bug in it which causes the slow-down when Alerts are disabled.

If you have the source code for the indicator, then you will have to analyse it and fix it, or create a clean version just for use by your EA.

EDIT: Alternatively, search the CodeBase for an equivalent indicator.

 

Paul Anscombe #: yes, but he is not skipping the later inputs, he is inserting extra inputs in the middle so they will not align with the indicator inputs.

No! He is doing it correctly. The buffer index and the shift are always the last 2 parameters.

iCustom

Calculates the specified custom indicator and returns its value.

double  iCustom(
   string       symbol,           // symbol
   int          timeframe,        // timeframe
   string       name,             // path/name of the custom indicator compiled program
   ...                            // custom indicator input parameters (if necessary)
   int          mode,             // line index
   int          shift             // shift
   );
 
Fernando Carreiro #:

No, he is doing it correctly. The buffer index and the shift are always the last 2 parameters.

I stand corrected :) and deleted to avoid confusion

 
Paul Anscombe #:I stand corrected :) and deleted to avoid confusion

No problem, but I will leave my post for other users to understand how to use iCustom() correctly in these cases.

 
I see the problem lies on the indicator code itself and I don't have the source code. Thanks for the explanation.
 
iCustom() function in mql4 have issue when string input parameters are passed
 
Afsal Meerankutty #:
iCustom() function in mql4 have issue when string input parameters are passed

I have never noticed any such problem.

Please explain what you mean.

 
Afsal Meerankutty #: iCustom() function in mql4 have issue when string input parameters are passed

There is no such problem and in this case, there are no string parameters, so it is not even relevant.