McClellan Oscillator

View as Markdown

Description

McClellan Oscillator is the difference between two exponential moving averages of the NYSE advance decline spread. This indicator requires ADV and DECL index data.

Syntax

McClellanOscillator(int fastPeriod, int slowPeriod)

McClellanOscillator(ISeries\<double\> input, int fastPeriod, int slowPeriod)

Return Value

double; Accessing this method via an index value int barsAgo returns the indicator value of the referenced bar.

Parameters

ParameterDescription
inputIndicator source data (Series<T>)
fastPeriodNumber of bars used in the fast moving average calculation
slowPeriodNumber of bars used in the slow moving average calculation

Examples

1// An ADV and DECL data series must be added to OnStateChange()
2else if (State == State.Configure)
3{
4 AddDataSeries("^ADV");
5 AddDataSeries("^DECL");
6}
7
8// Prints the current value of the McClellan Oscillator with a 19 fast period moving average & 39 slow period
9double value = McClellanOscillator(19, 39)[0];
10Print("The current McClellan Oscillator value is " + value.ToString());