Indicator Validation

 
Hello guys.

Im trying to validate a indicator in mql5 market, but:


test on EURUSD,H1 (netting)
 expert file MQL5\include\candlestickpatterns.ex5 open error [2]
 expert file MQL5\Indicators\include\candlestickpatterns.ex5 open error [3]
 program file include\candlestickpatterns.ex5 read error
 program file Indicators\include\candlestickpatterns.ex5 read error
 loading of candlestickpatterns EURUSD,H1 failed [557]
 2022.05.01 00:00:00   cannot load custom indicator 'include\candlestickpatterns' [4802]
 2022.05.01 00:00:00   indicator create error in 'candlestickpatterns.mq5' (1,1)
 test134261 (EURUSD,H1) OnInit return code is -1
 cannot initialize indicator
 disconnected

the onCalculate part is ok.

The indicator run with no errors and works fine.

#property copyright "rod reis"
#property version   "1.00"
#include <CandlestickType.mqh>
#property indicator_chart_window
#property indicator_label1  ""
#property indicator_type1   DRAW_LINE
#property indicator_color1  Blue
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
#property indicator_buffers 5
#property indicator_plots   1
input int   InpPeriodSMA   =10;
input bool  InpAlert       =true; 
input int   InpCountBars   =1000;
input color InpColorBull   =DodgerBlue; 
input color InpColorBear   =Tomato;  
input bool  InpCommentOn   =true;  
input int   InpTextFontSize=8;     
string prefix="Patterns ";
datetime CurTime=0;
int signal = 0;
double signalbuffer[];
int OnInit()
  {
   SetIndexBuffer(0,signalbuffer,INDICATOR_DATA);
   ResetLastError();
   signal=iCustom(NULL,0,"include\\candlestickpatterns",
                     0,
                     0,
                     0,
                     signal
                     );
   Print("Signal Buffer = ",signal,"  error = ",GetLastError());
//---
   return(INIT_SUCCEEDED);
  }
bool CopyBuffer(const string source_name,
const string source_buffer,
const int source_shift,
const int source_count,
const string destination_name,
const string destination_buffer,
const int destination_shift,
const int destination_count)
{
return(CopyBuffer(source_name, source_buffer, source_shift, source_count, destination_name, destination_buffer, destination_shift, destination_count));
}
Any idea about why i got this error -1?
 

Have you chosen the correct category:


 
You can't do this 
include\\candlestickpatterns"

for uploading to the marketplace.


You have to load the indicator as a resource

#property copyright "rod reis"
#property version   "1.00"
#include <CandlestickType.mqh>
#property indicator_chart_window
#property indicator_label1  ""
#property indicator_type1   DRAW_LINE
#property indicator_color1  Blue
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
#property indicator_buffers 5
#property indicator_plots   1


#resource "\\Indicators\\include\\candlestickpatterns.ex5"


input int   InpPeriodSMA   =10;
input bool  InpAlert       =true; 
input int   InpCountBars   =1000;
input color InpColorBull   =DodgerBlue; 
input color InpColorBear   =Tomato;  
input bool  InpCommentOn   =true;  
input int   InpTextFontSize=8;     
string prefix="Patterns ";
datetime CurTime=0;
int signal = 0;
double signalbuffer[];
int OnInit()
  {
   SetIndexBuffer(0,signalbuffer,INDICATOR_DATA);
   ResetLastError();
   signal=iCustom(NULL,0,"::Indicators\\include\\candlestickpatterns",
                     0,
                     0,
                     0,
                     signal
                     );
   Print("Signal Buffer = ",signal,"  error = ",GetLastError());
//---
   return(INIT_SUCCEEDED);
  }


in this case the "include" folder where your indicator "candlestickpatterns" is located should be located within the data directory "Indicators" folder