Skip to content
All library documents

Three EMA Alignment Indicator and Its Color States

Article MQL5 code base

Summary

The indicator compares three moving averages whose configured periods must increase from the first average to the second and then the third. It colors the display green when all three averages are ordered from highest to lowest, and red when they are ordered from lowest to highest. Any other arrangement is shown in orange.

This is a visual summary of moving average alignment that can help identify directional configurations, but the document does not define entry or exit rules, specify the moving average type or periods, or provide backtest evidence. It notes that the current final bar can repaint, so the displayed state on that bar may change before the bar is complete.

Key ideas

  • The three moving average periods must be ordered from shortest to longest.
  • A descending alignment of the averages produces a green state.
  • An ascending alignment produces a red state, while mixed alignments are orange.
  • The current final bar may repaint, so its signal can change before closure.

Tags

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