Skip to content
All library documents

Drawing Fractal Trend Lines and Detecting Breakouts in MQL

Article MQL5 articles

Summary

The article explains how to automate support and resistance lines from the two nearest upper and lower fractals, comparing implementations in MQL4 and MQL5. It describes finding fractal bars, retrieving their prices and times, refining daily-chart extremes with M15 data, and drawing or updating chart objects. It also discusses checking that enough history is loaded and detecting line breaks, with optional push notifications limited to one every four hours.

For practical use, the author suggests waiting for a pullback after a trend-line break before entering, and notes that the lines may help identify patterns such as triangles. The article is primarily a programming walkthrough, not a measured trading study: it provides no performance evidence for the breakout approach and acknowledges that other implementations may be more efficient. Its examples and proposed entry idea should therefore be treated as illustrative rather than evidence of a profitable strategy.

Key ideas

  • The method anchors support and resistance lines on the two nearest lower and upper fractals.
  • MQL4 retrieves fractal values directly, while MQL5 copies indicator buffers into arrays and searches them.
  • The author refines larger-timeframe extremes using M15 data because fractal timing can differ across timeframes.
  • Trend-line breaks can be checked against the prior close and can trigger rate-limited push notifications.
  • The suggested trading approach waits for a pullback after a break, but the article supplies no performance test.

Tags

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