McClellanOscillator

Description

The McClellan Oscillator is a market breadth indicator based on the difference between the number of advancing and declining stocks on exchange.

There are two modes of calculating the market breadth: simple and ratio-adjusted. In the simple mode, it is calculated as the plain difference between the number of advancing and declining stocks. In the ratio-adjusted mode, the difference of these values is divided by their sum and multiplied by 1000; thus, the market breadth is normalized to the -1000/+1000 scale.

Once the market breadth is calculated, the difference between fast and slow EMAs of this value is the final result.

It is considered a Buy signal when the McClellan Oscillator surpasses the zero level and a Sell signal if it falls below. The primary plot is also accompanied with overbought and oversold levels.

 

Input Parameters

Parameter Description
exchange Defines market to use advance/decline data from.
fast length The number of bars used to calculate the fast EMA.
slow length The number of bars used to calculate the slow EMA.
over bought Fixes the overbought level.
over sold Fixes the oversold level.
ratio adjusted Defines whether or not to use the ratio-adjusted mode of market breadth calculation.

Plots

Plot Description
McClellanOsc The McClellan Oscillator plot.
OverBought The overbought level.
OverSold The oversold level.
ZeroLine The zero level.

Example*

*For illustrative purposes only. Not a recommendation of a specific security or investment strategy.

  Past performance is no guarantee of future performance.