Skip to content
All library documents

Using CCI Threshold Crosses to Color a Moving Average by Trend

Article MQL5 code base

Summary

The indicator described changes the color of a moving-average line when the Commodity Channel Index crosses configured upper or lower thresholds. An upward crossing marks an uptrend state and a downward crossing marks a downtrend state, providing a visual trend cue for a trading pair. The description exposes settings for the moving-average period and calculation method, CCI period and applied price, both threshold levels, the number of bars displayed, and an option to reverse the signal directions.

This is a configurable chart aid rather than a fully specified trading strategy. The document does not give default parameter values, a rule for handling repeated or ambiguous crossings, or evidence from testing. It also does not explain how the trend labels should determine entries, exits, or risk controls. Traders would need to choose and validate settings for their market and timeframe before treating the color changes as actionable signals.

Key ideas

  • The indicator recolors a moving average when CCI crosses configured thresholds.
  • An upward threshold crossing signals an uptrend state, while a downward crossing signals a downtrend state.
  • Users can configure the moving-average and CCI periods, calculation inputs, threshold levels, and displayed bar count.
  • A setting can reverse the mapping between crossings and trend directions.
  • The description provides no tested performance or complete entry and exit rules.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.