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 on Vela
Run it on Vela. Go further with a paid plan.
- Up to 500 strategy alerts, with webhook automation
- Up to 10× the chart history of Free
- Orderflow lookback up to full history
- Up to 100,000 monthly credits for Quant to customize it
- Futures data alongside crypto, stocks, forex and commodities
Also works on
Run it on Vela. Make it yours with Quant.
Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.

