Skip to content
All library documents

Defining Swing Highs and Swing Lows with Neighboring Bars

Article MQL5 code base

Summary

The note defines a swing high by comparing a candidate high with nearby bars: the two highs immediately before it rise toward the candidate, while the two following highs decline. A swing low uses the inverse pattern, with preceding lows falling into the candidate and subsequent lows rising away from it. These local turning points can help describe market structure and are often used as inputs to chart analysis.

The definition depends on bars on both sides of the candidate, so a swing point is only identifiable after later price data arrives. The note does not specify how to handle equal highs or lows, missing bars, or alternative lookback widths, and it reports no tested trading strategy. It also mentions that an indicator’s buffer color can be changed in its code, a display customization rather than a signal validation method.

Key ideas

  • A swing high has two rising highs before it and two falling highs after it.
  • A swing low has two falling lows before it and two rising lows after it.
  • Confirmation requires observing bars after the candidate turning point.
  • The note does not define tie handling or test a trading strategy.

Tags

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