All indicators

WaveTrend Oscillator + Divergence + Direction Detection +Alerts

Nov 11, 2019

Static chart image
SignalsOscillatorsDivergencesMoving AveragesPatterns

The WaveTrend Oscillator + Divergence indicator provides a comprehensive momentum analysis tool by combining the classic WaveTrend algorithm with automated divergence detection and trend direction tracking. It helps traders identify cyclical overbought and oversold market conditions while highlighting potential trend reversals through price-momentum discrepancies.

Usage

The Usage section describes how the script can be used, examples should be provided in this section. This tool is primarily used to identify market extremes and potential turning points. Traders typically look for the "Media WT" line to cross its signal line within the shaded overbought or oversold zones to signal potential entries.

Momentum and Direction

The indicator includes a direction detection feature that changes the color of the main WaveTrend line based on its slope. A green line indicates rising momentum, while a red line indicates falling momentum. Users can adjust the "Reaction" setting to filter out minor fluctuations or increase sensitivity to fast moves.

Divergence Detection

The script automatically identifies four types of divergences:

  • Regular Bullish/Bearish: Potential trend reversals when price makes a new extreme but the oscillator fails to do so.
  • Hidden Bullish/Bearish: Potential trend continuation signals when the oscillator makes a new extreme but the price fails to do so.

Visual Aids

The indicator features a histogram to visualize the distance between the WaveTrend line and its signal, as well as a "Paint Bars" feature that highlights candles where specific buy or sell conditions are met.

Details

The WaveTrend calculation is based on the relationship between the typical price (HLC3) and its Exponential Moving Average (EMA). By calculating the absolute deviation of price from its average, the script creates a normalized oscillator that fluctuates between fixed levels.

The divergence logic utilizes a fractal-based approach, looking back at previous peaks and troughs to compare price action against oscillator peaks. The "Reaction En Cambio De Direccion" setting acts as a smoothing buffer; higher values require more sustained movement before the trend direction (and line color) updates, effectively acting as a noise filter.

Settings

Core Settings

  • Longitud Del Canal: Sets the period for the channel length used in the initial EMA calculation.
  • Periodo Movil: Sets the period for the secondary smoothing of the oscillator.
  • Reaccion En Cambio De Direccion: Controls the sensitivity of the direction detection (color changes).
  • Nivel Sobre Compra / Sobre Venta: Defines the threshold for the overbought and oversold shaded regions.

Filtering and Display

  • Solo Ventas en Sobre Compra: When enabled, sell signals are only displayed if the oscillator is above the overbought level.
  • Solo Compras en Sobre Venta: When enabled, buy signals are only displayed if the oscillator is below the oversold level.
  • Ver Histograma: Toggles the visibility of the oscillator histogram.
  • Ver Media de Señal: Toggles the visibility of the secondary signal line (wt2).
  • Pintar Barras: Enables or disables the coloring of chart candles based on signals.

Divergences

  • Ver Divergencias (Regulares/Ocultas): Individual toggles for different types of bullish and bearish divergences.
  • Ver Etiquetas De Divergencias: Toggles the "R" (Regular) and "O" (Hidden/Oculta) labels on the chart.

Extra Moving Average

  • Activar media movil Extra: Enables an additional moving average filter.
  • MA Extra Tipo: Choose from various types including SMA, EMA, WMA, HullMA, and more.
  • MA Extra Periodo: Sets the length for the extra moving average.

FAQ

How do I interpret the colored circles on the oscillator? Green circles represent bullish crossovers (Buy signals), and red circles represent bearish crossovers (Sell signals). Depending on your settings, these may only appear in overbought or oversold zones.

What is the difference between Regular and Hidden divergences? Regular divergences generally signal a potential trend reversal, while Hidden divergences often suggest the current trend is likely to continue after a brief consolidation.

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