All indicators

SuperTrend

Mar 14, 2021

Static chart image
SignalsMoving Averages

The SuperTrend indicator is a strategy tool designed to identify potential trend reversals and entry points by utilizing Double Exponential Moving Averages (DEMA) calculated across multiple timeframes.

Usage

The indicator can be used to identify bullish and bearish momentum shifts based on the crossover of two DEMA components. A "BUY" signal is generated when the faster-reacting DEMA crosses above the slower DEMA, suggesting an upward trend. Conversely, a "SELL" signal is triggered when the slower DEMA crosses below the faster one, indicating potential downward pressure. These signals are calculated on a 30-minute basis regardless of the chart interval to provide a smoothed perspective on trend direction.

Details

The script implementation relies on two core calculations:

  1. DEMA Calculation: The strategy uses a Double Exponential Moving Average formula ($2 \times EMA - EMA(EMA)$) to reduce lag compared to traditional moving averages.
  2. Multi-Timeframe Analysis: While the underlying EMA lengths are set to 5 and 2, the final DEMA values are requested via request.security from a 30-minute timeframe. This ensures that the strategy reacts to broader trend movements while being plotted on any chart timeframe.
  3. Signal Logic: The strategy executes long entries on crossovers and short entries on crossunders, accompanied by optimized alerts for real-time notifications.

Settings

  • EMA 5: The primary period used for the first DEMA calculation basis.
  • EMA 2: The secondary period used for the second DEMA calculation basis.
  • Timeframe (Internal): Fixed at 30 minutes for the DEMA security requests to provide consistent trend signals.

FAQ

How do I use the SuperTrend signals?

You can look for "BUY" and "SELL" labels on the chart which occur when the DEMA lines cross, indicating a shift in momentum.

What timeframes does this work on?

While the script calculates its data based on a 30-minute interval, you can apply the indicator to any chart timeframe to see how those higher-timeframe trends interact with local price action.

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.