Group lines in a custom indicator take parameter slots in iCustom() and IndicatorCreate(), so numbers passed without placeholders silently shift to the wrong inputs. CIndicatorInputs reads the live slot layout, fills the group slots, rejects values the terminal would change, and verifies the handle on a chart, so an EA gets the requested settings or an error. In the Strategy Tester it builds the handle from a saved layout without verification. Unit tests and a tester EA show both modes.
When an EA calls a custom indicator through iCustom() or IndicatorCreate(), it must pass the inputs in the order the terminal expects. If the indicator uses input groups, that order differs from the one in the inputs dialog. Each group line takes a slot of its own. In my tests on builds 6204 and 6230, the terminal accepted a shifted list of numeric values without any error. The CIndicatorInputs class reads the slot order from a running indicator instance. You set each value by its input number. The class fills the group slots and, on a chart, reads the created handle back to check every value. In the Strategy Tester the terminal does not report the order. There the class builds the handle from a layout file saved on a chart, and that handle stays unverified.
BandsLite, the small bands indicator attached to this article, has four inputs in two groups. I called it with iCustom(..., 50, 2.5, 3, 80.0), the way the parameter list of iCustom() suggests. The handle was valid and nothing appeared in the journal. The indicator received a period of 2, a deviation of 3.0, and the defaults for the other two inputs. Over 4,577 bars of EURUSD H1 in 2026, the intended settings gave 32 signals and the call I actually wrote gave 0. An EA built on that call would compile, load, and run without ever opening a trade.
The article measures the problem first and then builds the class. It covers which values each slot accepts through both functions, including negative, out-of-range, and non-finite values. It also covers a Strategy Tester restriction and how the class works around it. There are 61 unit tests, a tester EA, and a Python script that repeats the main calculations as a consistency check.
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.
Check out the new article: MQL5 Developer Gotchas (Part 1): A Parameter Mapper for Calling Indicators with Input Groups.
When an EA calls a custom indicator through iCustom() or IndicatorCreate(), it must pass the inputs in the order the terminal expects. If the indicator uses input groups, that order differs from the one in the inputs dialog. Each group line takes a slot of its own. In my tests on builds 6204 and 6230, the terminal accepted a shifted list of numeric values without any error. The CIndicatorInputs class reads the slot order from a running indicator instance. You set each value by its input number. The class fills the group slots and, on a chart, reads the created handle back to check every value. In the Strategy Tester the terminal does not report the order. There the class builds the handle from a layout file saved on a chart, and that handle stays unverified.
BandsLite, the small bands indicator attached to this article, has four inputs in two groups. I called it with iCustom(..., 50, 2.5, 3, 80.0), the way the parameter list of iCustom() suggests. The handle was valid and nothing appeared in the journal. The indicator received a period of 2, a deviation of 3.0, and the defaults for the other two inputs. Over 4,577 bars of EURUSD H1 in 2026, the intended settings gave 32 signals and the call I actually wrote gave 0. An EA built on that call would compile, load, and run without ever opening a trade.
The article measures the problem first and then builds the class. It covers which values each slot accepts through both functions, including negative, out-of-range, and non-finite values. It also covers a Strategy Tester restriction and how the class works around it. There are 61 unit tests, a tester EA, and a Python script that repeats the main calculations as a consistency check.
Author: Ali Akbar