Skip to content

Add WaveTrend Oscillator indicator (#6411)#9421

Closed
AlexCatarino wants to merge 1 commit into
QuantConnect:masterfrom
AlexCatarino:feature-6411-wavetrend-oscillator
Closed

Add WaveTrend Oscillator indicator (#6411)#9421
AlexCatarino wants to merge 1 commit into
QuantConnect:masterfrom
AlexCatarino:feature-6411-wavetrend-oscillator

Conversation

@AlexCatarino

Copy link
Copy Markdown
Member

Description

Implements the WaveTrendOscillator indicator (bar-based composite) per the linked issue. Adds the indicator class, the WTO helper in QCAlgorithm.Indicators.cs, unit tests inheriting CommonIndicatorTests<IBaseDataBar>, and a TA-Lib generated reference CSV under Tests/TestData/spy_wto.csv.

The oscillator is computed as:

HLC3 = (High + Low + Close) / 3
ESA  = EMA(HLC3, channelPeriod)
D    = EMA(|HLC3 - ESA|, channelPeriod)
CI   = (HLC3 - ESA) / (0.015 * D)
WT1  = EMA(CI, averagePeriod)    (exposed as the indicator's Current value)
WT2  = SMA(WT1, signalPeriod)    (exposed as the Signal property)

Defaults: channelPeriod=10, averagePeriod=21, signalPeriod=4, giving a warm-up of 42 bars.

Related Issue

Closes #6411

Motivation and Context

The WaveTrend Oscillator is a popular momentum oscillator used to identify overbought and oversold conditions and potential trend reversals via crossovers between its two lines. It has been requested by the community (see linked issue and forum discussion) and is currently missing from the LEAN indicator library.

Requires Documentation Change

Yes — add the following entry to Documentation/Resources/indicators/IndicatorImageGenerator.py (in the indicators dict):

'Wave-Trend-Oscillator': IndicatorInfo(
    WaveTrendOscillator(10, 21, 4),
    'WTO(symbol, 10, 21, 4)',
    'self.wto(symbol, 10, 21, 4)'
),

How Has This Been Tested?

  • dotnet build QuantConnect.Lean.sln succeeds.
  • dotnet test Tests/QuantConnect.Tests.csproj --filter FullyQualifiedName~WaveTrendOscillatorTests — 15/15 pass.
  • Reference values generated via Tier 1 (TA-Lib talib.EMA / talib.SMA) on SPY daily data from the LEAN public data repository, matching within 1e-4 for both WT1 and the signal line WT2.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention feature-<issue>-<description>

@AlexCatarino AlexCatarino deleted the feature-6411-wavetrend-oscillator branch April 20, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement WaveTrend Oscillator Indicator

1 participant