Skip to content

Add WaveTrend Oscillator indicator#9419

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

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

Conversation

@AlexCatarino

@AlexCatarino AlexCatarino commented Apr 20, 2026

Copy link
Copy Markdown
Member

Description

Implements WaveTrendOscillator (BarIndicator) per issue #6411. Adds the
indicator class, the WTO helper in QCAlgorithm.Indicators.cs, unit tests
inheriting CommonIndicatorTests<IBaseDataBar>, and the TA-Lib-generated
reference CSV under Tests/TestData/spy_wto.txt.

The indicator's Current.Value exposes the main wave trend line (WT1 = EMA of
the channel index). A public Signal property exposes the signal line
(WT2 = SMA of WT1). Formula follows the LazyBear TradingView script:

ESA = EMA(HLC3, n1);  D = EMA(|HLC3 - ESA|, n1)
CI  = (HLC3 - ESA) / (0.015 * D)
WT1 = EMA(CI, n2);    WT2 = SMA(WT1, m)

Default parameters: n1=10, n2=21, m=4.

Related Issue

Closes #6411

Motivation and Context

Community request from the QuantConnect forum (linked in the issue). The
WaveTrend Oscillator is a popular momentum indicator that currently has no
native support in LEAN, forcing users to re-implement it in algorithms.

Requires Documentation Change

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

'WaveTrend-Oscillator': IndicatorInfo(
    WaveTrendOscillator(10, 21, 4),
    'WaveTrendOscillator(10, 21, 4)',
    'WTO(_symbol, 10, 21, 4)',
    'self.wto(self._symbol, 10, 21, 4)'
),

All parameters are integer periods, so no m suffix is required on the C# entries.

How Has This Been Tested?

  • dotnet build QuantConnect.Lean.sln (0 errors)
  • dotnet test Tests/ --filter WaveTrendOscillatorTests (13 passed)
  • Reference values generated via TA-Lib using the script posted by
    @LouisSzeto in the issue; agreement within 1e-4.

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-<N>-<description>

@AlexCatarino AlexCatarino changed the title Add WaveTrend Oscillator indicator (#6411) Add WaveTrend Oscillator indicator Apr 20, 2026
@AlexCatarino AlexCatarino force-pushed the feature-6411-wavetrend-oscillator branch from 7bd18da to bf14692 Compare April 20, 2026 19:13
Implements `WaveTrendOscillator` (BarIndicator) per issue QuantConnect#6411. Adds
the indicator class, the `WTO` helper in `QCAlgorithm.Indicators.cs`,
unit tests inheriting `CommonIndicatorTests<IBaseDataBar>`, and the
TA-Lib-generated reference CSV under `Tests/TestData/spy_wto.txt`.

The indicator's `Current.Value` exposes the main wave trend line
(WT1 = EMA of the channel index). A public `Signal` property exposes
the signal line (WT2 = SMA of WT1). Formula follows the LazyBear
TradingView script:

    ESA = EMA(HLC3, n1);  D = EMA(|HLC3 - ESA|, n1)
    CI  = (HLC3 - ESA) / (0.015 * D)
    WT1 = EMA(CI, n2);    WT2 = SMA(WT1, m)

Default parameters: n1=10, n2=21, m=4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AlexCatarino AlexCatarino force-pushed the feature-6411-wavetrend-oscillator branch from bf14692 to 0dc7e1e Compare April 20, 2026 19:16
@AlexCatarino AlexCatarino deleted the feature-6411-wavetrend-oscillator branch April 20, 2026 20:47
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