Skip to content
All library documents

Using K-Means Centroids to Map Price Liquidity Clusters

Article MQL5 code base

Summary

The document describes an indicator that applies K-means clustering to historical price points. It groups prices by density and treats each cluster’s center, or centroid, as a potential area of concentrated liquidity. The intended use is to plot support and resistance levels that update as market prices change, offering a rule-based alternative to manually drawn chart levels.

The author says the indicator is implemented natively in MQL5 and recalculates its clusters at selected intervals. These are design claims; the document provides no test results, data specifications, parameter settings, or comparison with other ways of estimating liquidity. Clustered historical prices alone do not establish the presence of institutional orders or predict how price will react at a level. The text also ends at an execution heading without describing entry, exit, or risk rules, so it presents an indicator concept rather than a complete trading strategy.

Key ideas

  • K-means groups historical price points into clusters based on their density.
  • The indicator uses each cluster’s center as a candidate liquidity level.
  • Centroids are intended to serve as dynamic support and resistance references.
  • The described implementation runs in MQL5 and refreshes clusters at selected intervals.
  • The document provides no empirical validation or complete trading rules.

Tags

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