Skip to content
All library documents

Averaging Recent Swing High and Low Fractals

Article ProRealCode

Summary

This ProRealTime indicator plots averages of recent swing-high and swing-low fractal prices, plus a midpoint between those averages. The parameter p sets how many detected fractals contribute to each average. BarsBefore and BarsAfter determine the neighboring-bar pattern used to identify a swing: highs must be surrounded by lower highs and lows by higher lows over the configured bars. The guide illustrates how changing these settings changes the pattern being recognized.

The indicator can display or hide each of its three lines, and the page says it requires ProRealTime version 11 or later. It presents code but no chart examples, market tests, or evidence that the lines predict reversals or support and resistance reliably. Fractals are confirmed only after the specified bars following a candidate swing have formed, so the plotted levels may lag turning points. The included code should also be checked in the target platform: its repeated assignment to BarsBefore appears inconsistent with the accompanying description of separate before and after settings.

Key ideas

  • The indicator averages the latest p swing-high and swing-low fractal prices.
  • A third line marks the midpoint between the two averages.
  • BarsBefore and BarsAfter configure the neighboring-bar pattern that qualifies a fractal.
  • A swing is confirmed only after the required bars following the candidate point have formed.
  • The document provides no performance evidence, and its sample code merits validation.

Tags

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