All indicators

Supertrend

Jan 5, 2025

Static chart image
Price Action BasedSignalsMoving Averages

The Supertrend indicator is a comprehensive trend-following tool that integrates customizable moving averages with dynamic range calculations to help traders visualize market direction and potential trend shifts.

Usage

The Supertrend script can be used to identify trend direction and potential entry/exit points through color-coded visualizations and signals. Traders can use the indicator to determine if the market is in a bullish or bearish state based on the relationship between price, a smoothing moving average, and calculated price ranges.

  • Trend Identification: The indicator changes the color of candlesticks and the primary plot lines based on the current trend. A green aesthetic typically represents bullish conditions, while a red aesthetic represents bearish conditions.
  • Signal Generation: Crossover signals are generated when the internal score (derived from price relative to the MA and range) crosses zero. These can be used as potential buy or sell alerts.
  • Support and Resistance: The range indicator line and its associated fill area act as dynamic support or resistance levels, providing visual context for price volatility and potential reversal zones.

Details

The indicator operates by combining two primary components: a smoothing Moving Average and a dynamic range based on historical highs.

The range component calculates a highest high over a specific period, which is then adjusted by two multipliers (Alpha and Beta) to create dynamic thresholds. Depending on the user's settings, the trend is determined by comparing the current price to either the average of these thresholds or specific lookback values of these thresholds.

The moving average component offers ten different calculation types (SMA, EMA, SMMA, WMA, VWMA, TEMA, DEMA, LSMA, HMA, or ALMA). By calculating a "score" based on whether price is above or below these technical markers, the script produces a definitive trend bias.

Settings

Range Settings

  • Length: Sets the lookback period for calculating the highest high used in the range logic.
  • Lookback Alpha: The specific lookback period for the Alpha multiplier threshold.
  • Lookback Beta: The specific lookback period for the Beta multiplier threshold.
  • Multiplier Alpha: A coefficient used to adjust the primary range threshold.
  • Multiplier Beta: A coefficient used to adjust the secondary range threshold.
  • Source: The price source used for range calculations (e.g., OHLC4).
  • Use Average Range: A toggle to decide if the trend logic should use the average of both thresholds or individual lookbacks.

Moving Average Settings

  • Type: Selects the method for smoothing price action (e.g., VWMA, EMA, etc.).
  • Length: The period used for the moving average calculation.
  • Source: The price source for the moving average (default is Close).

Colors

  • Bullish Color: Sets the color for bullish trends and signals.
  • Bearish Color: Sets the color for bearish trends and signals.

FAQ

How do I use the different Moving Average types?

You can select your preferred smoothing method in the "Type" dropdown within the Moving Average Settings. For example, VWMA is useful for incorporating volume, while EMA provides faster reactions to recent price changes.

What is the difference between "Use Average Range" and the standard mode?

When "Use Average Range" is enabled, the script averages the two calculated dynamic thresholds to determine the trend. When disabled, it uses specific lookback values (Alpha and Beta) for a more granular trend calculation.

How can I access 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.