WaveTrend Oscillator

Calculate the WaveTrend Oscillator: how far the typical price lies from its average in units of its average distance, smoothed, to show overbought and oversold levels and turning points.

The WaveTrend Oscillator of LazyBear (2014) is a Commodity Channel Index built from exponential averages: the distance of the typical price from its EMA, divided by 0.015 times the EMA of that absolute distance, and smoothed with a longer EMA. Its signal line is a short simple average. Readings beyond 53 or 60 (or -53 and -60) are read as overbought (or oversold), and the oscillator crossing its signal line there as a turn.

The formula is as follows:

\[\text{Typical Price} = \frac{\text{High} + \text{Low} + \text{Close}}{3}\] \[\text{ESA} = \operatorname{EMA}(\text{Typical Price},\; \text{channel\_window})\] \[D = \operatorname{EMA}(\left|\text{Typical Price} - \text{ESA}\right|,\; \text{channel\_window})\] \[\text{CI} = \frac{\text{Typical Price} - \text{ESA}}{0.015 \cdot D}\] \[\text{WaveTrend} = \operatorname{EMA}(\text{CI},\; \text{average\_window})\] \[\text{Signal Line} = \operatorname{SMA}(\text{WaveTrend},\; \text{signal\_window})\]

LazyBear’s parameters are 10, 21 and 4.

Also known as: WaveTrend, WT, WTO, WT1 and WT2.

Example · AAPL, MSFT · 2024 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_wavetrend_oscillator:

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["AAPL", "MSFT"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2024-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_wavetrend_oscillator().xs("AAPL", level=1, axis="columns")

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

How did Apple's WaveTrend Oscillator move against its signal line in 2025?

Which returns:

Parameters

get_wavetrend_oscillator accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe time period to consider for historical data. Options are: “intraday” (intraday prices), “daily” (daily prices), “weekly” (weekly prices), “monthly” (monthly prices), “quarterly” (quarterly prices), “yearly” (yearly prices). Defaults to “daily”."weekly"
close_columnstrThe column name for closing prices in the historical data. Defaults to “Adj Close”, in which case the high and low prices are adjusted for dividends in the same way."Close"
channel_windowintThe number of periods of the EMA of the typical price and of its distance. Defaults to 10.10
average_windowintThe number of periods of the EMA of the CI. Defaults to 21.21
signal_windowintThe number of periods of the SMA that gives the signal line. Defaults to 4.4
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the WaveTrend and signal line. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper LazyBear (2014). “WaveTrend Oscillator [WT].” TradingView published script.
  • Library Referenced against TA-Lib’s WAVETREND
  • Library Shares similar logic as finta’s WTO
Share