Skip to content
All library documents

Validating Trendline Breakouts with Swing Points and R-Squared

Article MQL5 articles

Summary

The article outlines an automated trendline breakout system that finds swing highs and lows, connects them into candidate support or resistance lines, and checks those lines using touch counts, spacing, angle limits, and an R-squared fit criterion. Trades are triggered when price closes beyond a line or when the full candle crosses it. Configurable stop-loss and risk-to-reward settings define trade management, while chart lines, markers, and labels display detected structures and signals.

The document describes an MQL5 implementation and says the system was backtested, but the supplied text contains no readable performance figures or report details. Its evidence therefore cannot establish profitability, robustness, or suitability across instruments and market regimes. The method also depends on discretionary parameter choices, including lookback, touch tolerance, minimum fit, and breakout definition; these choices would need careful evaluation to determine their effect on signals and risk.

Key ideas

  • Swing highs and lows provide the points used to construct candidate support and resistance trendlines.
  • Touch counts, angle constraints, spacing, and R-squared filter candidate lines.
  • A breakout can be defined by a candle close beyond the line or by the whole candle crossing it.
  • Stop-loss distance and a risk-to-reward setting govern the example's trade management.
  • The article mentions backtesting but supplies no results that support a performance conclusion.

Tags

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