Skip to content
All library documents

Trend-Line Bounce and Breakout-Retest Rules for an MQL5 Expert Advisor

Article MQL5 articles

Summary

This tutorial describes an MQL5 Expert Advisor that derives ascending lines from recent swing lows and descending lines from swing highs, then trades price interactions with those lines. It distinguishes bounce entries from breakout entries: a bullish or bearish candle after a touch confirms a reversal, while a break followed by a retest and confirming candle signals a possible continuation in the breakout direction. Stop-loss and take-profit distances are configurable, and the EA uses candle data and time checks to avoid acting on stale or duplicate signals.

The article presents this as reusable logic for patterns such as wedges, flags, triangles, and channels, and explains comparing candle prices with a line’s value at a given time. Its evidence is an implementation walkthrough and code logic, not a performance study. The signal rules rely on swing-point and candle interpretation, and the article explicitly frames the project as a programming exercise rather than a live trading recommendation; no backtest results or evidence of profitability are reported.

Key ideas

  • The EA constructs rising and falling trend lines from recent swing lows and swing highs.
  • A candle response at an unbroken line can confirm a bounce entry in the direction of the prevailing trend.
  • A break followed by a retest and confirming candle can trigger an entry in the breakout direction.
  • Configurable stop-loss and take-profit distances manage trade exits.
  • The tutorial explains implementation logic but supplies no performance results and cautions against treating the example as live-ready.

Tags

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