I have a custom indicator with the following inputs (in the following order):
inputint period = 10; // first position in the indicator settingsinputbool 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 initializationif(!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:
inputbool Bold = true; // first position in the indicator settingsinputint 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 worksparams[1].integer_value=true;
params[2].type=TYPE_INT;
params[2].integer_value=24;
//--- object initializationif(!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?
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.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I have a custom indicator with the following inputs (in the following order):
and register the custom indicator within a new class with a property:
with the following initialization:
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:
with
Does anyone know why? I assume it's a bug. Where can I submit a bug report?