Free: indicator teardowns, a repaint checker and open-source scripts. No buy/sell signals, ever.

Taught to TradeSystems over signals.

Explainers / WaveTrend Oscillator

WaveTrend Oscillator, explained from its source

LazyBear's WaveTrend Oscillator is one of the most-boosted free indicators on TradingView, and dozens of popular scripts are built on top of it. It draws two wavy lines between overbought and oversold bands, and people trade the crosses. This page explains it from the published source code. The short version: WaveTrend is, in effect, a smoothed Commodity Channel Index.

The formula

Everything starts from the typical price, the average of high, low and close.

  1. Take a 10-bar EMA of the typical price.
  2. Measure how far price is from that EMA, and take a 10-bar EMA of that distance (always positive).
  3. Divide the first gap by 0.015 times the average distance.
  4. Smooth the result with a 21-bar EMA. That is the main line (WT1).
  5. Take a 4-bar simple average of WT1. That is the signal line (WT2).

ci = (hlc3 - EMA10) / (0.015 x EMA10 of |hlc3 - EMA10|), then WT1 = EMA21(ci) and WT2 = SMA4(WT1)

The shaded area is the gap between the two lines, WT1 minus WT2.

Why it is really a CCI

The Commodity Channel Index is the typical price minus its average, divided by 0.015 times the average deviation. Step 3 above is the same calculation with exponential averages in place of simple ones, and the same 0.015 constant. WaveTrend then smooths that CCI-like value with a 21-bar EMA.

Two things follow:

What the 60 and 53 levels mean

They are fixed lines the author chose, not a statistic of your chart. Because the value is scaled by volatility, the line reaches them often, even when nothing is happening.

In a simulation on pure random-walk prices (200,000 bars, nothing to predict), the main line spent about 1 bar in 9 beyond plus or minus 60, and about 1 in 5 beyond plus or minus 53. Making the simulated volatility jump between calm and wild periods barely changed those numbers.

So "overbought" on WaveTrend means "recent prices are high relative to their own recent average and wiggle", not "price is about to fall". Treat a reading beyond 60 as common, not rare.

The crosses

The "WaveTrend with Crosses" version marks every point where the two lines cross. In the same random-walk simulation the lines crossed about once every 7 bars, and roughly 1 cross in 7 happened beyond the 60 levels. A cross is a 4-bar average catching up with the line it averages. It happens constantly by construction, so any filter you add matters far more than the cross itself.

Does WaveTrend repaint?

Not on closed bars. It uses only the current and past bars: no higher-timeframe request, no future data, no offset.

The live bar does change. Until the bar closes, the typical price moves with every tick, so both lines move and a cross can appear and then vanish. The "with Crosses" version draws its circles and bar colours with no check for a closed bar, so a marker you see mid-bar may not be there at the close. For the full picture see what repainting is, or paste a script into the repaint checker.

Settings, honestly

There is no best setting. A shorter average gives earlier turns and more false crosses; a longer one gives fewer crosses and more lag. That trade-off does not go away.

WaveTrend vs RSI

RSI compares average up-moves with average down-moves and is bounded between 0 and 100. WaveTrend measures distance from an average, scaled by volatility, and has no fixed bounds. Both are momentum oscillators built from smoothed price changes, so on most charts they turn at similar times. See the RSI explainer.

The audit version on TradingView

We rewrote WaveTrend from scratch and published it free and open source: Taught to Trade - WaveTrend Audit. At the default settings it computes the same two lines as LazyBear's original. It adds what the original leaves out: a cross is marked only once the bar has closed (a cross on the still-open bar shows as a grey pending dot), and a panel counts, on your own chart, how often the line sits beyond each level, how many times the two lines cross and the median number of bars between crosses.

Where it fails

Also explained

Educational content only. Not financial advice. Nothing here is a recommendation to buy or sell anything. Original script by LazyBear on TradingView; this page explains its published source and quotes no code.

Also explained: Repaint checker, VWAP, Supertrend, RSI, UT Bot Alerts, Nadaraya-Watson Envelope, Squeeze Momentum, What is repainting on TradingView?, Is TradingView backtesting accurate?, Chandelier Exit, QQE MOD, Pivot highs and lows, Hull Suite, Range Filter, Twin Range Filter, HalfTrend, ZigZag++, SSL Hybrid, CM MacD Ultimate MTF, Volume Profile / Fixed Range, ADX and DI, Support Resistance Channels, Market Structure Break & Order Block, Order Block Finder, Pivot Point SuperTrend, Trendlines with Breaks [LuxAlgo], Divergence for Many Indicators, TradingView script selling terms, Support and Resistance Levels with Break, Liquidity Swings [LuxAlgo], Pine Script errors, Breakout Probability (Expo), Did ChatGPT or Claude write your Pine Sc, Lorentzian Classification, SuperTrend AI (Clustering), Machine Learning Adaptive SuperTrend, Dynamic Swing Anchored VWAP, Support and Resistance Power Channel by , Support and Resistance (High Volume Boxe, Trendline Breakouts With Targets by Char, Breakout Finder by LonesomeTheBlue

Next steps

  • Get a script fixed. Compiles but behaves differently live, or changes after a reload? In a Pine Script Audit, an AI model reads every line and writes a report on what to fix for $49, or also fixes those problems for $149. It cannot prove a script is safe.
  • Check your own script. Paste its source into the free repaint checker. It runs in your browser and flags known patterns.
  • Read our rebuild. WaveTrend Audit is free and open source: the same oscillator with crosses marked only once the bar has closed.
Subscribe to the Teardown Letter: $19/moBack to Taught to Trade

No TradingView account yet? This affiliate link gives you a $15 coupon toward a paid plan, and we earn a commission if you buy one. The free plan is enough to follow this page.