Skip to content
All library documents

Trading MACD Momentum Sequences on New Bars

Article MQL5 code base

Summary

This expert advisor uses the standard MACD indicator to generate directional entry signals. It marks a buy condition when the MACD main line has declined or remained level across the three most recent indexed readings, and a sell condition when those readings have risen or remained level. These rules use a short sequence of MACD values rather than a signal-line crossover.

The advisor acts only when a new bar appears, and this timing restriction applies to both signal generation and trailing behavior. The document gives no exit specification beyond mentioning trailing, position sizing, risk controls, parameter choices, or backtest evidence. It therefore describes a basic indicator-driven trading rule, but does not show whether it is profitable or how it should be deployed across instruments or timeframes.

Key ideas

  • The advisor bases entries on the direction of a short sequence of MACD main-line readings.
  • A buy condition is triggered by consecutive non-increasing MACD readings.
  • A sell condition is triggered by consecutive non-decreasing MACD readings.
  • Signal generation and trailing actions occur only when a new bar appears.
  • The document does not provide performance evidence or detailed risk-management rules.

Tags

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