Skip to content
All library documents

Volume-Weighted K-Means for Clustered Volume Profiles

Article ProRealCode

Summary

The indicator divides recent price action into clusters using one-dimensional K-means on bar midpoint prices, with trade volume weighting the centroid updates. It then builds a separate volume profile for each cluster, using the actual high-low envelope of its assigned bars. This can distinguish multiple regions of trading activity that a single profile might blend into an unrepresentative central point of control (POC).

Within each cluster, the method splits each bar’s volume among the profile bins in proportion to the overlap between the bar’s price range and each bin. The highest-volume bin becomes that cluster’s POC. Each profile is scaled to its own maximum, so histogram lengths show the distribution within a cluster; separate total-volume labels are needed to compare clusters. The implementation uses deterministic centroid initialization and falls back to bar-count weighting when volume data is absent. The document explains the calculation and display choices but provides no trading rules or evidence of predictive performance.

Key ideas

  • The method clusters bar midpoint prices with centroids weighted by bar volume.
  • Each cluster’s profile range comes from the high and low prices of its assigned bars, so ranges may overlap.
  • Bar volume is distributed across bins according to the fraction of its price range intersecting each bin.
  • Each cluster has its own POC and independently normalized histogram, so bar lengths cannot compare total activity across clusters.
  • When volume is unavailable, the implementation uses equal bar weights as a fallback.

Tags

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