Skip to content
All library documents

K-Means++ Clustering for Forex Signals with Raw Prices and Fractal Data

Article MQL5 articles

Summary

The article introduces k-means clustering and contrasts it with hierarchical clustering and alternatives such as k-medians, k-medoids, Jenks natural breaks, and fuzzy clustering. It focuses on k-means++ initialization, which chooses initial centers in a more structured way than simple random selection before Lloyd-style iterations refine the clusters. The author argues this can improve convergence speed and reduce sensitivity to initial centers and outliers.

The method is applied to GBP/USD daily data, first using changes in closing prices and then using fractal price points. The article describes a training and walk-forward evaluation and reports that the close-price approach looked more promising in preliminary cross-validation, while the fractal variant did not produce a profitable forward test despite an encouraging initial test. It suggests that the fractal representation and its price-point selection may need refinement. The evidence is exploratory: the test span is limited, clustering choices require analyst judgment, and the results do not establish that either approach will work in other periods or markets.

Key ideas

  • K-means requires a chosen number of clusters and iteratively assigns observations around cluster centers.
  • K-means++ spreads initial centers across the data to improve the clustering initialization.
  • The article compares k-means with methods that use medians, observed data points, natural breaks, or fuzzy membership.
  • GBP/USD tests compare close-price changes with fractal price data, and the close-based approach appears more promising in the reported evaluation.
  • The results are preliminary and the fractal approach may require a redesigned input representation.

Tags

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