Skip to content
All library documents

Head and Shoulders Forex EA with Moving Average and Trend Filters

Article MQL5 code base

Summary

The document describes an automated strategy built around a head and shoulders pattern. It defines confirmation as a decline from the third peak below the lowest intervening valley. The EA draws trend lines using fractals and combines the pattern with two moving averages; the trend line acts as a filter during live trading. It is described as operating on the open candle and supporting major forex pairs and NASDAQ stocks.

The notes list optional money-based or percentage profit targets, trailing stops, break-even settings, equity drawdown controls, and limits on concurrent trades. They also describe increasing position size after losses, which can compound exposure. A central limitation is that the trend-line filter is not included in backtest trade decisions: tests use moving averages, while visual mode can display the line. The document supplies configuration ranges but no performance evidence, validation results, or detailed rules for detecting the three peaks and valleys. Its claims about improved win probability are unsupported by reported data.

Key ideas

  • The pattern is considered confirmed when price falls below the lowest valley between its three peaks.
  • The EA combines the pattern with moving averages and a fractal-based trend-line filter in live trading.
  • Backtests do not include the trend-line filter in trade generation, limiting their comparability with live behavior.
  • Risk controls include stop losses, equity limits, trailing stops, and configurable position sizing.
  • Increasing lot size after losses can raise exposure, and the document provides no performance evidence.

Tags

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