Machine Learning Adaptive SuperTrend runs on MT4 and MT5 and replaces one number in the ordinary SuperTrend formula. That's the whole change, and it's a bigger change than it sounds.

A normal SuperTrend sets its band at the current ATR times a factor. This one sorts the recent ATR readings into three groups, decides which group today belongs to, and uses that group's average instead.

The trend line with its cluster number printed on every bar, EURUSD H1

The three regimes

Every bar's ATR goes into a rolling window, 100 bars by default. Over that window the tool runs a small k-means:

  1. Three starting guesses are placed at 75%, 50% and 25% of the way between the window's lowest and highest ATR.
  2. Every reading in the window is assigned to whichever guess it's closest to.
  3. Each guess moves to the average of the readings assigned to it.

That gives you three centroids: a high-volatility level, a medium one and a low one, measured on this instrument over the last hundred bars. The current bar is then assigned to its nearest centroid, and the SuperTrend band is built from that centroid's value rather than from the raw ATR.

The number printed on the chart next to the line is which cluster the bar landed in. 1, 2 or 3. That's not decoration; it's the tool telling you which volatility regime it thinks you're in, and you can watch the number change several bars before the trend does.

Why this changes the behaviour

A single violent bar lifts a 10-period ATR immediately, and an ordinary SuperTrend widens its band to match. The trailing stop moves away from price for a reason that has nothing to do with the trend.

Here, that bar changes which cluster the current reading belongs to only if it changes the regime. If the market has genuinely moved from quiet to busy, the cluster flips and the band steps out. If it was one bar, the band stays where it was, because the centroid for that regime hasn't moved much.

The band therefore moves in steps between regimes rather than continuously, which you can see directly on the chart: long flat stretches with an occasional jump.

Ordinary SuperTrend This
Band width Current ATR ร— factor Regime average ATR ร— factor
Reaction to one wild bar Band widens immediately Usually nothing
Regime awareness None Three clusters, numbered on the chart
What you can see A line The line plus which regime produced it

One pass, not iterated

Being straight about this, because "machine learning" invites the wrong assumption.

Textbook k-means repeats the assign-and-move loop until the centroids stop shifting. This does one pass: seed, assign, move. That's it. The iteration loop is in the source and it is switched off.

In practice that's fine, because the seeds aren't random โ€” they're placed at fixed percentiles of the observed ATR range, so they start close to where they'd converge. It's also a deliberate trade: an unbounded loop inside an indicator that runs on every bar of a long history is a way to hang a terminal.

What it means for you is that the clustering is a fast, stable, approximate split into three bands, not a converged solution. Same answer on the same data every time, which is what a chart needs.

Settings that matter

Training Data Length, 100 bars. This is the window the regimes are learned from. Short means the tool re-learns quickly and the clusters chase recent conditions; long means slower, steadier regimes. It is the setting to change first.

There's a hard constraint: Lookback must be at least twice Training Data Length, or the indicator refuses to start with an alert. If it won't load, that's usually why.

The three initial percentiles at 0.75, 0.5 and 0.25 decide where the seeds go. On an instrument whose ATR distribution is heavily skewed, moving them apart gives a cleaner split. Most charts don't need it.

ATR Length and SuperTrend Factor are the ordinary SuperTrend parameters, 10 and 3.

What it draws

Two plotted buffers, the trailing line in each direction, so iCustom gets both the level and the trend state. Arrows at each direction change, and the cluster number on each bar if Display cluster number is on.

The chart comment top-left names the current regime in words: Low Volatility, Medium Volatility, High Volatility.

Alerts are off out of the box: Notification type ships as Do not notificate. There are two separate switches, one for the trend signal and one for a change of volatility regime. The regime one is off by default and it's the more interesting of the two.

Where it's weak

Cluster numbers can flicker at a boundary. A reading sitting halfway between two centroids will hop between them bar to bar. The band barely moves when that happens, so it's cosmetic, but the printed number is noisier than the line it describes.

The window is the regime. With 100 bars, a market that has been quiet for six months and busy for the last week has centroids dominated by the quiet period. The tool has no memory beyond the window and no concept of a regime that lasted longer than it.

It's still a SuperTrend. In a range it flips, and using a regime average instead of the raw ATR reduces that but doesn't remove it. The band being steadier makes the flips less frequent and no less wrong.

No confirmation on the flip. Direction changes the bar price closes through the band. There's no persistence rule, no volume filter.

The line is drawn to the previous bar. The calculation stops one bar short of the live candle, so the newest value appears when the bar closes.

Questions you'll have

Does Machine Learning Adaptive SuperTrend repaint? No. Everything is computed on closed bars behind a new-bar check and the loop never touches the forming candle. Centroids move as the window rolls, which changes future band values, not past ones.

What is the number printed next to the line? The volatility cluster the bar was assigned to. It tells you which regime the band width came from.

Why won't the indicator load? Lookback has to be at least twice Training Data Length. There's an alert saying so when it fails.

Is this really machine learning? It's k-means over ATR readings, run one pass with fixed percentile seeds. That's a clustering algorithm, honestly named and not magic. The iteration to convergence is deliberately switched off so it can't hang on a long chart.

How is it different from a normal SuperTrend? The band width comes from the average ATR of the current volatility regime rather than the current ATR reading. One wild bar doesn't move the band.

Can an EA read the trend? Yes. Both direction lines are plotted buffers, so iCustom gets the level and the state. The cluster numbers and arrows are chart objects.

Best timeframe? H1 and H4. On M5 a 100-bar window is under nine hours, which is not long enough for three distinguishable regimes.

MT4? Both platforms are included, one download each. Same clustering, same seeds, same two buffers.

Support

Message me through the site with a screenshot, the symbol and the timeframe, and I can tell you which regime the band is coming from. Updates are included for as long as your subscription runs.

Analysis tool. It places no trades and makes no profitability claim. Past price behaviour is not a guide to future price behaviour.