Skip to content
All library documents

Using MACD Zero-Line States to Color Price Candles

Article MQL5 code base

Summary

This MetaTrader indicator colors chart candles according to whether the MACD main line is above or below zero. It uses configurable fast and slow exponential moving average periods and a signal smoothing period, with defaults of 12, 26, and 9. Separate buffers assign candle open, close, high, and low values to the positive and negative states so the chart can display the corresponding bars.

The indicator can issue audible, email, or push alerts when the current bar is in either state; the latter two notification types are configurable. The document describes a visualization and alerting tool rather than a complete trading method: it does not specify entry or exit rules, evaluate performance, or discuss asset selection and risk management. A zero-line state alone therefore should not be read as evidence of a profitable signal.

Key ideas

  • The indicator marks candles according to whether the MACD main line is above or below zero.
  • Its default MACD settings use fast, slow, and smoothing periods of 12, 26, and 9.
  • Candle price components are assigned to separate display buffers for positive and negative MACD states.
  • Audible, email, and push alerts are available, but the document provides no trading rules or performance evidence.

Tags

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