Controlling Indicator Parameters with Draggable Chart Objects
Summary
This article demonstrates a graphical method for changing an indicator’s external parameters directly on a chart. Using the standard ZigZag indicator as an example, it displays three selectable values for each of its depth, deviation, and backstep settings, then places a colored index beside each group. Moving an index vertically selects the corresponding parameter value.
The implementation stores candidate values and screen coordinates in arrays, reads each index’s vertical position, maps it to a low, middle, or high setting, and passes the resulting values to the ZigZag indicator. It then plots the indicator using those settings. The approach is presented as adaptable to other indicators whose parameters can be exposed in a similar way. The example is an older MQL4 implementation and uses a small fixed set of choices rather than a continuous value control; the article offers a user-interface technique, not evidence that any chosen parameter improves trading performance.
Key ideas
- Chart objects can expose indicator settings for adjustment with the mouse.
- The example provides three candidate settings each for ZigZag depth, deviation, and backstep.
- An index object's vertical location selects the low, middle, or high candidate value.
- The selected settings are passed to the indicator, which is recalculated and displayed on the chart.
- The method can be adapted to other indicators, though the example uses fixed choices and does not evaluate trading results.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.