Hi all,
I'm programmatically loading a custom indicator using IndicatorCreate() and passing values for the indicator's input parameters via the params[] array.
My custom indicator uses input group declarations like " " and "--- Tick Density" to visually organize input settings in the parameters dialog. These groups are just for padding and clarity.
Question:
Do input group lines count as parameters when building the params[] array for IndicatorCreate() ? In other words, should I include a slot in params[] for each input group , or are they ignored?
Thanks in advance for your help — just want to make sure the parameter ordering stays in sync!
Forum on trading, automated trading systems and testing trading strategies
Help me debug ... cannot load indicator 'Relative Strength Index' [4002]
Alain Verleyen, 2021.05.22 17:49
Because you can't just omit the "group" parameter in your iCustom call. They need a value.I struggled with the same situation before regarding input group.
From the iCustom() documentation:
"[in] input-parameters of a custom indicator, separated by commas. Type and order of parameters must match. If there is no parameters specified, then default values will be used." (iCustom - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5).
And from the Input Variables documentation to which the above iCustom() documentation links:
"The input storage class defines the external variable...
Passing Parameters When Calling Custom Indicators from MQL5 Programs #
Custom Indicators are called using the iCustom() function. After the name of the custom indicator, parameters should go in a strict accordance with the declaration of input variables of this custom indicator. If indicated parameters are less than input variables declared in the called custom indicator, the missing parameters are filled with values specified during the declaration of variables." (Input Variables - Variables - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5).
Perhaps the key is understanding that an input group is inherently within the input storage class. But yes, the documentation does not expressly address all input types.
From the iCustom() documentation:
"[in] input-parameters of a custom indicator, separated by commas. Type and order of parameters must match. If there is no parameters specified, then default values will be used." (iCustom - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5).
And from the Input Variables documentation to which the above iCustom() documentation links:
"The input storage class defines the external variable...
Passing Parameters When Calling Custom Indicators from MQL5 Programs #
Custom Indicators are called using the iCustom() function. After the name of the custom indicator, parameters should go in a strict accordance with the declaration of input variables of this custom indicator. If indicated parameters are less than input variables declared in the called custom indicator, the missing parameters are filled with values specified during the declaration of variables." (Input Variables - Variables - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5).
Perhaps the key is understanding that an input group is inherently within the input storage class. But yes, the documentation does not expressly address all input types.
It was something I realized later. Seeing as the "group" variable is literally only for grouping inputs and not anything to modify the indicator - one would think it should be omitted from iCustom. It's just a tricky one. Notes in documentation to express that would always be beneficial, however we also have to respect that document writers also don't catch these things, they are only human. This is why the forum is good, as people who know the answer to the problem can give you the answer. Some people even asked MQL5 questions on stack overflow
It was something I realized later. Seeing as the "group" variable is literally only for grouping inputs and not anything to modify the indicator - one would think it should be omitted from iCustom. It's just a tricky one. Notes in documentation to express that would always be beneficial, however we also have to respect that document writers also don't catch these things, they are only human. This is why the forum is good, as people who know the answer to the problem can give you the answer. Some people even asked MQL5 questions on stack overflow
Yeah, the official documentation is geared toward experienced developers. It's not a training manual. The word, "class," is a term of art involving inheritance in object-oriented programming. Even to this day, I still refer to OOP MQL5 as the "new" MQL5 language because I first started coding indicators and EA's in MQl4 and then MQL5 well before OOP was added.
I now use embedded custom functions in lieu of iCustom() wherever and whenever possible. IMHO, the iCustom() function is responsible for enticing many less-experienced coders over to MQL4/5. It certainly got me auto trading many moons ago. This is all the more reason that an input group discussion should be added to the Input Variables documentation.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I'm programmatically loading a custom indicator using IndicatorCreate() and passing values for the indicator's input parameters via the params[] array.
My custom indicator uses input group declarations like " " and "--- Tick Density" to visually organize input settings in the parameters dialog. These groups are just for padding and clarity.
Question:
Do input group lines count as parameters when building the params[] array for IndicatorCreate() ? In other words, should I include a slot in params[] for each input group , or are they ignored?
Thanks in advance for your help — just want to make sure the parameter ordering stays in sync!