Error when adding a new product

Ahmed Abd El Aziz  


I try to add a new MQl5 indicator to the market,

but it gives me this error: "Please recompile your product with new compiler"

I searched for this error, but i can't solve it

I work on windows 7 ,32 B

How can i solve this problem?


The code :

- Work fine

- Has no #includes

- 0 errors, 0 warnings, 945 msec elapsed

#property copyright "Created with MN"
#property link      "https://www.mn.com"
#property version   "1.00"
#property description ""

//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 2

#property indicator_type1 DRAW_ARROW
#property indicator_width1 3
#property indicator_color1 0xFFAA00
#property indicator_label1 "Buy"

#property indicator_type2 DRAW_ARROW
#property indicator_width2 3
#property indicator_color2 0x0000FF
#property indicator_label2 "Sell"

//--- indicator buffers
double Buffer1[];
double Buffer2[];

double myPoint; //initialized in OnInit
int RSI_handle;
double RSI[];
double Low[];
double High[];

void myAlert(string type, string message)
  {
   if(type == "print")
      Print(message);
   else if(type == "error")
     {
      Print(type+" | new compiler @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
     }
   else if(type == "order")
     {
     }
   else if(type == "modify")
     {
     }
  }

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {   
   SetIndexBuffer(0, Buffer1);
   PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, EMPTY_VALUE);
   PlotIndexSetInteger(0, PLOT_ARROW, 241);
   SetIndexBuffer(1, Buffer2);
   PlotIndexSetDouble(1, PLOT_EMPTY_VALUE, EMPTY_VALUE);
   PlotIndexSetInteger(1, PLOT_ARROW, 242);
   //initialize myPoint
   myPoint = Point();
   if(Digits() == 5 || Digits() == 3)
     {
      myPoint *= 10;
     }
   RSI_handle = iRSI(NULL, PERIOD_CURRENT, 14, PRICE_CLOSE);
   if(RSI_handle < 0)
     {
      Print("The creation of iRSI has failed: RSI_handle=", INVALID_HANDLE);
      Print("Runtime error = ", GetLastError());
      return(INIT_FAILED);
     }
   
   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime& time[],
                const double& open[],
                const double& high[],
                const double& low[],
                const double& close[],
                const long& tick_volume[],
                const long& volume[],
                const int& spread[])
  {
   int limit = rates_total - prev_calculated;
   //--- counting from 0 to rates_total
   ArraySetAsSeries(Buffer1, true);
   ArraySetAsSeries(Buffer2, true);
   //--- initial zero
   if(prev_calculated < 1)
     {
      ArrayInitialize(Buffer1, EMPTY_VALUE);
      ArrayInitialize(Buffer2, EMPTY_VALUE);
     }
   else
      limit++;
   
   if(BarsCalculated(RSI_handle) <= 0) 
      return(0);
   if(CopyBuffer(RSI_handle, 0, 0, rates_total, RSI) <= 0) return(rates_total);
   ArraySetAsSeries(RSI, true);
   if(CopyLow(Symbol(), PERIOD_CURRENT, 0, rates_total, Low) <= 0) return(rates_total);
   ArraySetAsSeries(Low, true);
   if(CopyHigh(Symbol(), PERIOD_CURRENT, 0, rates_total, High) <= 0) return(rates_total);
   ArraySetAsSeries(High, true);
   //--- main loop
   for(int i = limit-1; i >= 0; i--)
     {
      if (i >= MathMin(5000-1, rates_total-1-50)) continue; //omit some old rates to prevent "Array out of range" or slow calculation   
      
      //Indicator Buffer 1
      if(RSI[i] > 90 //Relative Strength Index > fixed value
      )
        {
         Buffer1[i] = Low[i]; //Set indicator value at Candlestick Low
        }
      else
        {
         Buffer1[i] = EMPTY_VALUE;
        }
      //Indicator Buffer 2
      if(RSI[i] < 10 //Relative Strength Index < fixed value
      )
        {
         Buffer2[i] = High[i]; //Set indicator value at Candlestick High
        }
      else
        {
         Buffer2[i] = EMPTY_VALUE;
        }
     }
   return(rates_total);
  }
//+------------------------------------------------------------------+
Fernando Carreiro  
Ahmed Abd El Aziz: I try to add a new MQl5 indicator to the market, but it gives me this error: "Please recompile your product with new compiler" I searched for this error, but i can't solve it

What build of MetaTrader 5 are you using? Mine is currently at build 3491.


Ahmed Abd El Aziz  
Fernando Carreiro #:

What build of MetaTrader 5 are you using? Mine is currently at build 3491.



How can i update?

William Roeder  
Ahmed Abd El Aziz: I work on windows 7 ,32 B

Windows 7 extended support period begins in January 2020 when Windows 7 support ended officially, and it ends in January 2023 for good.
          New MetaTrader 4 Platform build 1220 - MQL4 programming forum - Page 3 #26 (2020)

Support for the 32-bit platform version was discontinued 20.03, after the release of build 2361. We strongly recommend upgrading to the 64-bit MetaTrader 5 version in order to access all the platform's features without any limitation. (2020)

You can't "work on windows 7 ,32 B"

Fernando Carreiro  
Ahmed Abd El Aziz #: How can i update?
That is the old 32-bit version of MetaTrader 5. It is no longer supported. You will have to use a 64-bit operating system if you want to update and publish products.
Ahmed Abd El Aziz  
William Roeder #:

Windows 7 extended support period begins in January 2020 when Windows 7 support ended officially, and it ends in January 2023 for good.
          New MetaTrader 4 Platform build 1220 - MQL4 programming forum - Page 3 #26 (2020)

Support for the 32-bit platform version was discontinued 20.03, after the release of build 2361. We strongly recommend upgrading to the 64-bit MetaTrader 5 version in order to access all the platform's features without any limitation. (2020)

You can't "work on windows 7 ,32 B"

Is there a way to compile this indicator online for example?

Ahmed Abd El Aziz  
Fernando Carreiro #:

No! Even if that were possible, your code may not be 100% compatible with the latest MetaTrader and you would then need to change it.

You will have to update to 64 bit operating system, or not sell products.

I sent it to my friend and he compiled the file, but he got this error message:

"

File compiled in Debug mode

"

There are no #includes, errors or warnings, Why this error?

Ahmed Abd El Aziz  
Ahmed Abd El Aziz #:

I sent it to my friend and he compiled the file, but he got this error message:

"

File compiled in Debug mode

"

There are no #includes, errors or warnings, Why this error?

He recompiled the file and uploaded it again, and it was successful, but gave him an  error report "array out of range"

Fernando Carreiro  
Ahmed Abd El Aziz #: He recompiled the file and uploaded it again, and it was successful, but gave him an  error report "array out of range"
Then you need to fix your code, because the array indexing is incorrect and/or you are not checking your array limits properly.
Reason: