All indicators

SuperTrend Strategy

Sep 7, 2019

Static chart image
SignalsTrailing-StopVolatility

The SuperTrend Strategy indicator provides an automated framework for trend following by utilizing the Average True Range (ATR) to establish dynamic trailing stop levels.

Usage

The SuperTrend Strategy is primarily used to identify trend direction and potential entry or exit points based on volatility-adjusted price movements. When the price crosses above the calculated stop level, a "Buy" signal is generated, indicating a bullish trend. Conversely, when the price drops below the stop level, a "Sell" signal is triggered, indicating a bearish trend.

Users can choose to operate in a "Long Only" mode, which is suitable for trending bull markets or specific asset classes like equities, or disable it to allow for both long and short positions (flipping). The script also includes built-in backtesting parameters to limit the execution to a specific date range, allowing traders to evaluate performance over historical periods.

Details

The strategy is constructed using two primary components: the Average True Range (ATR) and the median price (HL2).

  • Trailing Stop Calculation: The indicator calculates an upper and lower band. The lower band (long stop) only moves upward during a bullish trend, while the upper band (short stop) only moves downward during a bearish trend. This "ratcheting" effect ensures that profits are protected as the trend progresses.
  • Directional Logic: The trend direction (dir) switches only when the closing price breaks the current stop level. This filtering mechanism helps reduce noise during sideways market conditions.

Settings

Main Settings

  • Long Only ?: When enabled, the strategy will only take long entries and close them on sell signals. When disabled, the strategy will toggle between long and short positions.
  • ATR Period: The lookback period used to calculate the Average True Range, affecting the sensitivity of the stop levels.
  • ATR Multiplier: The factor by which the ATR is multiplied to determine the distance of the stop level from the median price.
  • Show Buy/Sell Labels ?: Toggles the visibility of "Buy" and "Sell" text labels on the chart.

Backtesting Range

  • From/To Day: Defines the starting and ending day for the backtest.
  • From/To Month: Defines the starting and ending month for the backtest.
  • From/To Year: Defines the starting and ending year for the backtest.

FAQ

How do I adjust the sensitivity of the signals?

You can adjust the ATR Period or the ATR Multiplier. A higher multiplier will result in stops that are further from the price, reducing whipsaws but potentially delaying entries.

Can I use this for intraday trading?

Yes, the SuperTrend Strategy can be applied to any timeframe. However, users should adjust the ATR settings to match the volatility of the specific timeframe being traded.

How can I access the SuperTrend Strategy?

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.