Skip to content
All library documents

Detecting Three-Point Swings for Fibonacci Expansion Levels

Article MQL5 code base

Summary

This document describes an indicator that identifies three pivot points in either an upward or downward sequence, then draws a Fibonacci expansion object from those points. It scans historical bars for local highs and lows using comparisons with nearby bars. Separate state tracks the candidate points for each direction, updating or discarding candidates as new pivots are found; the search stops once a complete three-point sequence is identified.

The drawing function places expansion levels at 0.618, 1.000, 1.618, 2.618, and 4.236, with colors distinguishing upward and downward patterns. The example explains how the chart object is constructed, but it does not define trading entries, exits, or position sizing, and it gives no backtest results. The levels are presented as charting references rather than evidence of predictive value. Because pivots are determined from neighboring bars, users would need to check how the implementation handles confirmation timing and whether plotted points can change as additional bars arrive.

Key ideas

  • The indicator searches recent bars for local highs and lows to identify swing points.
  • It maintains separate three-point sequences for upward and downward directions.
  • Once it finds a complete sequence, it draws Fibonacci expansion levels from those points.
  • The example uses levels at 0.618, 1.000, 1.618, 2.618, and 4.236.
  • The document provides no entry rules or evidence that the plotted levels predict price movement.

Tags

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