Skip to content
All library documents

Moving Average Trend Filter with Support and Resistance Breakouts

Article MQL5 code base

Summary

The document outlines a rule-based breakout system using recent bars to calculate support and resistance, and a moving average to classify the prevailing trend. When price is above the moving average, the trend is treated as bullish and a resistance breakout opens a position. When price is below the average, the system treats conditions as bearish and enters on a support breakout.

Risk and exit rules place a long position’s stop at support and a short position’s stop at resistance. A position that has reached breakeven may also be closed on a breakout through the opposite level. The expert advisor includes a trailing stop with stated levels of 10, 20, and 30 points. The document is a short strategy description rather than an evaluation: it supplies no market, timeframe, backtest, transaction-cost assumptions, or performance results, so the rules alone do not establish an edge.

Key ideas

  • Support and resistance are calculated from a configurable number of recent bars.
  • A moving average classifies the trend as bullish above the average and bearish below it.
  • The strategy enters in the trend direction on a breakout of the corresponding support or resistance level.
  • Stops are placed at the opposite level, with additional breakeven exits and a trailing stop.
  • No backtest or performance evidence is provided.

Tags

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