OPEN-SOURCE SCRIPT

McClellan Oscillator [LazyBear ~ modified]

Updated
The McClellan Oscillator is a market breadth indicator developed by Sherman and Marian McClellan.

It is calculated from Net Advances, which is the number of advancing issues minus the number of declining issues. Subtracting the 39-day exponential moving average of Net Advances from the 19-day exponential moving average of Net Advances forms the oscillator.

The McClellan Oscillator can be traded with breadth thrusts, centerline crossovers and divergences.

The original code was written by LazyBear - I just modified it to add together all advancing and declining issues from all stock exchanges (NYSE + NASDAQ + others), to make it available on the hourly time frame and also add alerts.
Release Notes
Added the possibility of using only a percentage of each stock exchange's advancing and declining issues. You can do this in settings - for example you can use 100% of the NASDAQ advancing/declining issues, and 50% of NYSE. This is good for experimenting.
breadthBreadth IndicatorsMcClellan OscillatorOscillators

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer