CustomIndicator.Create: second param with INT does not work..

 

I have a custom indicator with the following inputs (in the following order):

input int period = 10;   // first position in the indicator settings
input bool Bold = true;  // second position in the indicator settings

and register the custom indicator within a new class with a property:

CiCustom          m_custom_indictor;

with the following initialization:

MqlParam params[3];

   params[0].type=TYPE_STRING;
   params[0].string_value="Indicators\\custom-indicator.ex5";

   params[1].type=TYPE_INT;   // Adding TYPE_INT in the second position doesn't work. The value isn't passed to the custom indicator.
   params[1].integer_value=24;

   params[2].type=TYPE_BOOL; 
   params[2].integer_value=true;

//--- object initialization
   if(!m_custom_indicator.Create(m_symbol.Name(),0,IND_CUSTOM,3,params))
     {
      printf(__FUNCTION__+": error initializing object");
      return(false);
     }

The indicator is initialized (without errors or warnings in the console). However, TYPE_INT (array position 1) is not successfully passed to the indicator settings.

If I use the following instead, it works successfully. Both input values ​​are successfully passed to the indicator settings:

input bool Bold = true; // first position in the indicator settings
input int period = 10;  // second position in the indicator settings

with

 MqlParam params[3];

   params[0].type=TYPE_STRING;
   params[0].string_value="::Indicators\\custom-indicator.ex5";

   params[1].type=TYPE_BOOL; // adding TYPE_BOOL at the second position works
   params[1].integer_value=true;

   params[2].type=TYPE_INT;
   params[2].integer_value=24;

//--- object initialization
   if(!m_custom_indicator.Create(m_symbol.Name(),0,IND_CUSTOM,3,params))
     {
      printf(__FUNCTION__+": error initializing object");
      return(false);
     }

Does anyone know why? I assume it's a bug. Where can I submit a bug report?

Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • 2009.11.23
  • www.mql5.com
I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.
 
If you want to report something you need to post all relevant code. The indicator code (simplified is ok), and the calling code, that compiles.