# Machine Learning Moving Average

Machine Learning Moving Average is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

A moving average rebuilt on Gaussian process regression, tunable from long-horizon smoothness to fast reaction through its Window and Forecast inputs. The line recolors with the estimated trend, bands frame the range price is likely to travel, and colored circles mark turning points where the trend color flips: a close beyond the opposite band while the average slopes that way.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jan 22, 2025.
- Access: free.
- Concepts: [Adaptive-lookback MA](https://www.luxalgo.com/library/concept/adaptive-lookback-ma/) (primary), [K-means Regime Clustering](https://www.luxalgo.com/library/concept/k-means-regime-clustering/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn3c91004mvhsgwwuadnfk
- Page: https://www.luxalgo.com/library/indicator/machine-learning-moving-average/

**Machine Learning Moving Average** behaves like an [adaptive moving average](https://www.luxalgo.com/library/concept/adaptive-lookback-ma/) you tune by intent: built on [Gaussian process regression](https://www.luxalgo.com/library/concept/gaussian-process-regression/), it smooths erratic price action into a trend line whose responsiveness you set directly. Bands around the average frame the range prices are likely to oscillate within, and the plot recolors as the trend estimate changes: blue for uptrends, fuchsia for downtrends by default.

## How to Trade the Machine Learning Moving Average?

- **Line color flips**: the recolor is the trend read, an immediate cue that the estimated direction has changed.
- **Price beyond the bands**: an escape from the expected range; turning points print as colored circles, highlighting potential entries and exits.
- **Wide Window**: filters short-term fluctuation for a long-term trend view.
- **High Forecast**: makes the average more responsive, but pushed too far it can overshoot, undermining the fit with actual price.

## Machine Learning Moving Average Settings

- **Window**: the calculation period; higher values smooth away short-term noise and emphasize the long-term trend.
- **Forecast**: the regression's projection horizon; high settings yield a reactive average, negative ones a smoother though possibly less precise line.
- **Sigma**: the noise level the regression assumes (the kernel's width follows Window); raising it shifts the average toward a longer-term view.
- **Multiplicative Factor**: band width; higher values widen the bands and thin out turning-point signals.

## Frequently Asked Questions

### What do the colored circles represent?

They mark turning points detected when price moves beyond the bands, moments the tool flags as potential opportunities to enter or exit. A higher Multiplicative Factor widens the bands and makes these signals rarer and more selective.

### How does it relate to SuperTrend-style tools?

[SuperTrend AI (Clustering)](https://www.luxalgo.com/library/indicator/supertrend-ai-clustering/) follows price with a stop-style line that flips sides, while this tool stays a centered average with bands, better suited to traders who want a smoothed centerline plus a volatility envelope.

### How much does the Machine Learning Moving Average cost?

It is completely free via the LuxAlgo Library, added from this very page, where Quant, our coding agent, can also backtest it for you. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Moving Average Converging](https://www.luxalgo.com/library/indicator/moving-average-converging/) (Adaptive-lookback MA): markdown at https://www.luxalgo.com/library/indicator/moving-average-converging.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
- [Trend Regularity Adaptive Moving Average](https://www.luxalgo.com/library/indicator/trend-regularity-adaptive-moving-average/) (TRAMA): markdown at https://www.luxalgo.com/library/indicator/trend-regularity-adaptive-moving-average.md
- [ZLEMA](https://www.luxalgo.com/library/indicator/zlema/) (Trend): markdown at https://www.luxalgo.com/library/indicator/zlema.md
- [MLMA](https://www.luxalgo.com/library/indicator/mlma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/mlma.md
- [Volume-adjusted MA](https://www.luxalgo.com/library/indicator/volume-adjusted-ma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/volume-adjusted-ma.md
- [JMA](https://www.luxalgo.com/library/indicator/jma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/jma.md

---

Source: https://www.luxalgo.com/library/indicator/machine-learning-moving-average/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
