All indicators

SMA MAD SuperTrend

Aug 31, 2025

Static chart image
SignalsMoving AveragesVolatility

The SMA MAD SuperTrend indicator provides a trend-following framework that utilizes Mean Absolute Deviation (MAD) and a Simple Moving Average (SMA) to identify market direction and potential reversals.

Usage

The indicator can be used to identify current market trends and potential entry or exit points based on price interaction with the dynamic bands.

  • Trend Identification: When the price is above the SuperTrend line, the line turns green, signaling a bullish trend. Conversely, when the price is below the line, it turns red (or purple), signaling a bearish trend.
  • Visual Cues: The script features bar coloring and filled areas between the price and the trend line to provide immediate visual confirmation of the prevailing market sentiment.
  • Signal Generation: A transition from a bearish to a bullish state (line flipping from top to bottom) serves as a long signal, while the reverse indicates a short signal.

Details

This tool innovatively replaces the standard Average True Range (ATR) found in traditional SuperTrend calculations with Mean Absolute Deviation (MAD).

  • Simple Moving Average (SMA): Acts as the core baseline for the calculation, smoothing price data to establish a central trend path.
  • Mean Absolute Deviation (MAD): Quantifies volatility by measuring the average absolute distance of prices from the mean. This offers a different sensitivity profile compared to ATR-based volatility measures.
  • Dynamic Bands: The SuperTrend mechanism constructs upper and lower bands based on the SMA +/- (Factor * MAD). These bands are designed to be "sticky," updating only when price breaks through or when volatility permits a trailing adjustment, which helps in filtering out minor market noise.

Settings

  • Source: Determines the price data used for the calculations (e.g., Close, Open, HL2).
  • SMA Length: Sets the lookback period for the baseline Simple Moving Average.
  • Factor: A multiplier applied to the MAD to determine the distance of the SuperTrend bands from the SMA. Higher values result in wider bands and fewer signals.
  • MAD Length: Specifies the period used to calculate the Mean Absolute Deviation.

FAQ

How do I interpret the color changes on the chart?

Green elements (lines, candles, and fills) indicate a bullish trend where the price is trading above the calculated volatility threshold. Red elements indicate a bearish trend where the price is trading below the threshold.

Can I set up notifications for trend changes?

Yes, the script includes built-in alert conditions for both "Long" (bullish flip) and "Short" (bearish flip) transitions, which can be configured through the TradingView alerts menu.

How can I access SMA MAD SuperTrend?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.