initialization failed (1) in optimization

 

I optimize my EA.

it take too long to pass data and not show result .

Although it passed over 100 data , it not show result in optimization results.

So I stop optimization , it show error as


2022.04.19 03:45:16.130    ZigZag EURUSD,M15: initialization failed (1).

zigzag is my custom indicator used in EA.

in zigzag indicator ,

int OnInit()
  {
   if(InpBackstep>=InpDepth)
     {
      Print("Backstep cannot be greater or equal to Depth");
      return(INIT_FAILED);
     }

InBackstep parameter not equal or greater than InDepth in my parameters.

why show initilization failed in this zigzag indicator.


is it related to this too long pass optimization process or is it normal?


2022.04.19 03:45:25.424 There were 1 passes done during optimization, 2 results have been discarded as insignificant

here latest log in journal.

 
  1. You said one hundred (100) passes, but your output shows three (3).
  2. Results → Right Click → Show Useless Results and rerun.
 
William Roeder #:
  1. You said one hundred (100) passes, but your output shows three (3).
  2. Results → Right Click → Show Useless Results and rerun.

after stop optimization , journal show that optimization stopped due to critical error in EA.

is it normal or due to stop optimization?


 
LONNV #: after stop optimization , journal show that optimization stopped due to critical error in EA. is it normal or due to stop optimization?

Then you will need to debug your EA code to find the bug that is causing the error.

 
int OnInit()
  {
   if(InpBackstep>=InpDepth)
     {
      Print("Backstep cannot be greater or equal to Depth");
      return(INIT_FAILED);

Following this rule I tried to set an optimization however it gives me the same error how can I optimize?

Files:
Cattura1.JPG  28 kb
 
texoro #: Following this rule I tried to set an optimization however it gives me the same error how can I optimize?

When the input parameters are incorrect, return INIT_PARAMETERS_INCORRECT instead of INIT_FAILED. The optimisation will then continue onto the next set of input parameter combinations.