AI Channels (Clustering)
By LuxAlgoAug 30, 2023
AI Channels (Clustering) draws its channel from data, not formula. Rolling K-means clustering groups the last Window Size prices, and the centroids of the lowest, average, and highest clusters become the lower extremity, center line, and upper extremity. Each extremity carries a dispersion area whose width mirrors how scattered prices are inside that cluster: a wide area is a volatile cluster, and price entering it has better odds of pushing clean through.
How to Trade the AI Channels (Clustering)?
- Upper extremity break: price moving above it reads as an uptrend; dropping below the lower extremity reads as a downtrend.
- Dispersion areas: treat a wide zone as a soft boundary. Price trading inside it raises the likelihood the extremity gives way.
- As Trailing Stop: flip the display mode and the channel becomes a trailing stop that shadows the detected trend.
- Tuning the read: larger Window Size values target longer-term trends, while more Clusters pushes the extremities further from price, making penetration rarer.
The default Denoise Channels option keeps the extremities steady for trend reading; disabling it plots the exact centroids at the cost of more irregular lines. Like the library's other machine learning tools, the clustering is compute-aware, with two performance inputs bounding the work per update.
AI Channels (Clustering) Settings
- Window Size: how many recent prices feed the clustering.
- Clusters: number of clusters detected within the window.
- Denoise Channels: smoother extremities on, exact centroids off.
- As Trailing Stop: switches the channel to trailing-stop display.
- Maximum Iteration Steps: caps the centroid search. Faster loads, potentially rougher clustering.
- Historical Bars Calculation: how many bars back the script computes.
Frequently Asked Questions
Free indicator
Get free access to this indicator on the platforms below.
The Library is free. Quant makes it yours.
Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.

