# AI SuperTrend Clustering Oscillator

AI SuperTrend Clustering Oscillator is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

The AI SuperTrend Clustering Oscillator sweeps a whole range of SuperTrend factors, measures each variant's distance from price, and clusters the results into three lines: most bullish, most bearish, and consensus. Consensus above zero reads as uptrend, and disagreement between the outputs can give early warning of reversals and retracements.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Aug 16, 2023.
- Access: free.
- Concepts: [Supertrend](https://www.luxalgo.com/library/concept/supertrend/) (primary), [K-means Regime Clustering](https://www.luxalgo.com/library/concept/k-means-regime-clustering/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn02xs0008vhsg911rrf3z
- Page: https://www.luxalgo.com/library/indicator/ai-supertrend-clustering-oscillator/

**AI SuperTrend Clustering Oscillator** compresses an entire family of [SuperTrend](https://www.luxalgo.com/library/concept/supertrend/) calculations into three readable lines. It sweeps the Factor Range, measures the difference between the closing price and every variant, and lets a k-means routine sort those differences into three clusters on every bar within the Historical Bars Calculation window. The centroids plot as the bullish output (the strongest upward group), the bearish output (the weakest), and a consensus output between them: one pane showing how much the whole SuperTrend spectrum agrees.

## How to Trade the AI SuperTrend Clustering Oscillator?

- **Consensus above zero**: the balance of the sweep reads uptrend; below zero, downtrend.
- **Bearish output above zero**: even the most bearish cluster is positive, strong confirmation of a bull trend. The mirror, a bullish output below zero, corroborates the bear case.
- **Outputs in conflict**: when the consensus direction is contradicted by the bullish or bearish output, treat the tension as an early warning of a reversal or retracement.
- **Biasing the sweep**: the minimum and maximum factors tilt the whole read toward short-term or long-term trends.

A Smooth input steadies all three outputs, and the performance inputs let you trade calculation depth for load time when the factor sweep gets dense.

## AI SuperTrend Clustering Oscillator Settings

- **ATR Length**: period of the ATR inside every SuperTrend in the sweep.
- **Factor Range**: the minimum and maximum factor values covered.
- **Step**: increment between factors. Finer steps mean a denser sweep.
- **Smooth**: smoothing applied to the indicator outputs.
- **Maximum Iteration Steps**: iteration cap for centroid calculation.
- **Historical Bars Calculation**: bars over which everything is computed.

## Frequently Asked Questions

### What does it mean when the outputs contradict each other?

Disagreement means the extremes of the sweep are pulling away from the average read, a tension that can precede a reversal or retracement. Many traders pull risk down at that point, or stand aside until the outputs realign.

### How does it relate to SuperTrend AI?

It extends the same research line. [SuperTrend AI](https://www.luxalgo.com/library/indicator/supertrend-ai-clustering/) works on the price chart itself, while this oscillator clusters the full factor sweep into bullish, bearish, and consensus lines in a separate pane: trend agreement as a reading rather than a level.

### How do I access the AI SuperTrend Clustering Oscillator?

Access is free on the LuxAlgo Library. This page can push it straight into Quant, our coding agent, for hands-on testing before it earns a slot on your layout. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Supertrend Channels](https://www.luxalgo.com/library/indicator/supertrend-channels/) (Supertrend): markdown at https://www.luxalgo.com/library/indicator/supertrend-channels.md
- [SuperTrend Oscillator](https://www.luxalgo.com/library/indicator/supertrend-oscillator/) (Supertrend): markdown at https://www.luxalgo.com/library/indicator/supertrend-oscillator.md
- [SuperTrend Recovery](https://www.luxalgo.com/library/indicator/supertrend-recovery/) (Supertrend): markdown at https://www.luxalgo.com/library/indicator/supertrend-recovery.md
- [SuperTrend AI (Clustering)](https://www.luxalgo.com/library/indicator/supertrend-ai-clustering/) (Supertrend): markdown at https://www.luxalgo.com/library/indicator/supertrend-ai-clustering.md
- [SuperTrend Polyfactor Oscillator](https://www.luxalgo.com/library/indicator/supertrend-polyfactor-oscillator/) (Supertrend): markdown at https://www.luxalgo.com/library/indicator/supertrend-polyfactor-oscillator.md
- [Supertrend Parameter Sensitivity 3D](https://www.luxalgo.com/library/indicator/supertrend-parameter-sensitivity-3d/) (Supertrend): markdown at https://www.luxalgo.com/library/indicator/supertrend-parameter-sensitivity-3d.md
- [Correlation Clusters](https://www.luxalgo.com/library/indicator/correlation-clusters/) (K-means Regime Clustering): markdown at https://www.luxalgo.com/library/indicator/correlation-clusters.md
- [AI Channels (Clustering)](https://www.luxalgo.com/library/indicator/ai-channels-clustering/) (K-means Regime Clustering): markdown at https://www.luxalgo.com/library/indicator/ai-channels-clustering.md

---

Source: https://www.luxalgo.com/library/indicator/ai-supertrend-clustering-oscillator/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
