LazyBear

McClellan Oscillator [LazyBear]

Developed by Sherman and Marian McClellan, the McClellan Oscillator is a breadth indicator derived from Net Advances, the number of advancing issues less 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.

As the formula reveals, the McClellan Oscillator is a momentum indicator that works similar to MACD .

McClellan Oscillator signals can be generated with breadth thrusts, centerline crossovers, overall levels and divergences.

I have added the following options:
- Can choose Advancing/Declining issues of any market. Default is NYSE.
- Can show the EMAs and/or oscillator.
- Ratio Adjusted Calculation mode (as explained in the stockcharts link below) or default mode.
- Can use custom timeframe. Default is chart timeframe.

More info:
http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:mcclellan_oscillator

Complete list of my indicators:
https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing

Thanks @mpinky for pointing out the StockCharts version of this oscillator.

Remove from Favorite Scripts Add to Favorite Scripts
//
// @author LazyBear 
// List of all my indicators: 
// https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
//
study("McClellan Oscillator [LazyBear]", shorttitle="MO_LB")
advissues=input(defval="ADVN", title="Advancing Stocks Symbol", type=symbol)
decissues=input(defval="DECN", title="Declining Stocks Symbol", type=symbol)
isRA=input(true, title="Stockcharts version (Ratio Adjusted)?")
rm=input(defval=1000, title="RANA ratio multiplier")
showEMAs=input(false, title="Show EMAs?")
showOsc=input(true, title="Show Oscillator?")

useCTF=input(false, title="Use Custom Timeframe?"), 
tf=useCTF?input("D", type=resolution, title="Custom Timeframe"):period
ai=security(advissues, tf, close), di=security(decissues, tf, close)
rana=rm * (ai-di)/(ai+di)
e1=isRA?ema(rana, 19):ema(ai-di, 19),e2=isRA?ema(rana, 39):ema(ai-di, 39)
mo=e1-e2

hline(0, title="ZeroLine")
plot(showOsc?mo<0?mo:0:na, style=area, color=red, title="MO_Negative")
plot(showOsc?mo>=0?mo:0:na, style=area, color=green, title="MO_Positive")
plot(showOsc?mo:na, style=line, color=black, title="MO", linewidth=2)
plot(showEMAs?e1:na, color=blue, linewidth=2, title="19 EMA")
plot(showEMAs?e2:na, color=red, linewidth=2, title="39 EMA")



LB you are a gentleman and scholar
+2 Reply
LazyBear PRO SPYderCrusher
Thank you for the kind words :)
+2 Reply
Thanks , finally !
+1 Reply
YW.
+1 Reply
Hi Lazybear,

i reckon there is another one called, McClellan Summation index?
Can both these be used on stock, i thought it is more suitable for indices? Thanks
Reply
LazyBear PRO jangseohee
Hi,

I can talk for the calculation part, will leave the proper usage and potential usecase scenarios to more experienced traders. :)

This is a breadth indicator, so makes use of the advancing/declining issues for a given market and not based on a single stock. AFAIK, SummationIndex is nothing but a running sum of McClellan oscillator.

BTW, I will publish the summationindex too today.
+1 Reply
Summation Index:
McClellan Summation Index [LazyBear]
+1 Reply
jangseohee LazyBear
Thanks
yes, the market breadth indicator part i understand :-)
Reply
Hey Jangseohee, yes, typically it is used as an index timing method, so possibly more suitable in that use, however in a stock which very high correlation of returns it will likely be the same difference, ex- whatever additional non-systematic risk is present in the individual stock.

If unfamiliar, you may want to look up the rules bc I know the McCllelans have a whole set of conditions in order to determine a buy or sell (as in, I don't believe they just go, "Oh Gee, the oscillator is at the lower end of the range, I should go long")
+1 Reply
jangseohee SPYderCrusher
@SPYderCrusher, as divergence indicator on one it's use
but i will refresh my memory again from stockcharts
Cheers
Reply
Good Job. Thanks for doing it. I had it for a future indicator, you did it. Now I have it. Thanks.
+1 Reply
Thanks ucsgears.
+1 Reply
ADVN / DECN is only for the NYSE. Did you happen to have the advance decline for the Nasdaq composite and Index?
Reply
For NASDAQ, use ADVQ / DVCQ

If you type "Advancing" or "Declining" in the symbol box, it should list the names for other mkts too.
+1 Reply
Great thanks, I just searched for it. I used stockcharts for all these. Now, I can code some setups, that works..
Reply
GREAT Indicator to Post....I've gotten McClellans reports for probably 10 years now...Good Job...Great Value to the community...

That's what I Call...Strait LazyBear Style....
+2 Reply
LazyBear PRO ChrisMoody
Thanks Chris
+1 Reply
Hi Good People,

How about if we want to chart the Advancing & Declining Volume(s) instead of Issues ?
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out