Skip to content
All library documents

MACD Crossovers with Moving-Average and Support/Resistance Filters

Article MQL5 code base

Summary

This automated strategy combines MACD crossovers with a 200-period moving average filter and support or resistance conditions. A buy setup requires the MACD main line to cross above its signal line below zero, price to be above the moving average, and price to touch support. A sell setup reverses these conditions: a bearish crossover above zero, price below the average, and a move above resistance. The MACD and price-action signals can occur on different candles, with a configurable validity period; the stated default is seven candles.

Risk controls place stops at a configurable distance from the moving average, below it for buys and above it for sells, and set the profit target at 1.5 times the stop distance. The document describes the rules and parameters but provides no performance results or market-specific testing. Support and resistance are subjective, and the excerpt leaves the signal-line parameter incomplete, so implementation details may need clarification before testing.

Key ideas

  • The strategy requires MACD crossovers to occur on the appropriate side of zero.
  • A 200-period moving average restricts trades to the direction of the prevailing price trend.
  • Support touches and resistance breaks add price-action filters to the MACD signals.
  • Signals may remain valid for several candles instead of needing to coincide.
  • Stops are positioned relative to the moving average, and the profit target is 1.5 times the stop distance.

Tags

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