All indicators

SuperTrend Weighted by Divergence

Dec 19, 2025

Static chart image
SignalsOscillatorsDivergencesVolatility

The SuperTrend Weighted by Divergence indicator is a trend-following tool that utilizes dynamic ATR weighting driven by momentum divergences to reduce lag and provide faster reactions to market reversals. By temporarily adjusting the ATR multiplier when a divergence is detected, the indicator allows the trend line to tighten during periods of weakening momentum, offering earlier signals than a standard SuperTrend.

Usage

The indicator can be used as a directional filter or a primary signal generator for trend-based strategies. Users should look for the following signals:

  • Trend Identification: A green line and green bars indicate a prevailing uptrend, while a red line and red bars indicate a downtrend.
  • Momentum Weakening: When a divergence against the current trend appears (marked by dots above or below bars), the SuperTrend line becomes more sensitive, signaling that the trend may be nearing an exhaustion point.
  • Trend Reversal: "Buy" and "Sell" labels appear when the price closes beyond the trailing line, confirming a shift in market regime.
  • In-Trend Recovery: If a divergence occurs in the direction of the current trend, the indicator invalidates any previous counter-trend divergence and returns to its standard ATR weighting.

Details

Traditional trend-following indicators often suffer from significant lag because they rely on historical volatility (ATR) as a constant buffer. This script addresses this by integrating a hidden auxiliary oscillator, the "MPO4 Lines – Modal Engine." This oscillator detects:

  • Bullish Divergence: Price makes a lower low while the oscillator makes a higher low.
  • Bearish Divergence: Price makes a higher high while the oscillator makes a lower high.

When these conditions are met, the script reduces the ATR multiplier based on the "Divergence Sensitivity" setting. This makes the trailing stop more aggressive. The effect lasts for a maximum of 200 bars unless canceled by a trend flip or a trend-aligned divergence.

Settings

General Settings

  • ATR Length: Determines the period used to calculate the Average True Range.
  • Base ATR Multiplier: Sets the standard width of the SuperTrend trailing line.
  • Pivot Length (Left/Right): Controls the sensitivity of the divergence detection. Increasing this value requires more confirmation bars, leading to delayed but potentially more reliable divergence markers.
  • Divergence Sensitivity: A value between 0.0 and 1.0 that defines the strength of the multiplier reduction. 0.0 disables the weighting, while 1.0 provides the maximum reduction.

Color Settings

  • Color bars by trend: Toggles the bar coloring functionality.
  • Uptrend Color (Bullish): Customizes the visual color for bullish regimes.
  • Downtrend Color (Bearish): Customizes the visual color for bearish regimes.

FAQ

How do I access SuperTrend Weighted by Divergence?

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

Does this indicator repaint?

No, the indicator is designed to be non-repainting. Divergences are detected based on confirmed pivots, and trend changes are confirmed only upon the bar close.

What timeframes are best for this tool?

While it works on all timeframes, higher sensitivity settings (0.4–0.5) are better suited for scalping and day trading, whereas lower sensitivity settings are more effective for swing trading on daily or weekly charts.

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.