Skip to content
All library documents

Williams Fractals for Identifying Local Price Extremes

Article Strategy library · Author: CHATHURANGA91

Summary

The visible script implements Williams-style up and down fractals by comparing a candidate bar's high or low with surrounding bars. A parameter controls the number of periods used on each side, with a minimum setting specified. The code also includes optional display controls for fractal markers and two exponential moving averages, with default lengths of 20 and 50.

Fractal points are only confirmed after later bars have formed, so a marker placed back on the candidate bar represents a retrospectively identified turning point rather than a signal available at that earlier time. The supplied text is truncated partway through the second EMA definition, before any order-entry or exit rules are visible. It therefore supports discussion of fractal detection and display, but does not establish how the named strategy trades those points or provide backtest evidence. Any use as a trading system would require the remaining rules and an evaluation that accounts for confirmation delay.

Key ideas

  • An up fractal marks a local high relative to bars on either side, while a down fractal marks a local low.
  • The fractal period setting controls how many neighboring bars participate in the comparison.
  • A fractal is confirmed only after subsequent bars have formed, creating a delay before it is actionable.
  • The visible code includes optional fractal and exponential moving-average displays.
  • The provided script is truncated before its entry and exit rules, and no performance results are shown.

Tags

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