WaveTrend Oscillator + Divergence + Direction Detection +Alerts
Nov 11, 2019

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.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

