The Nifty can climb 1% on a day when two out of every three stocks in the market close lower. A handful of heavyweights do the lifting, the index looks fine, and the average portfolio quietly bleeds. The McClellan oscillator is built to catch exactly that gap. It takes the daily count of advancing and declining stocks, smooths it with two moving averages, and tells you whether participation is gaining or losing steam.
We’ll cover how the indicator is calculated, how to read its three main signals, and how to run it on an Indian universe like the Nifty 500 constituents. The worked example uses advance and decline numbers we made up for illustration and calculated ourselves. They aren’t real NSE data, and nothing here is a forecast.
In this article
Where the McClellan oscillator comes from
Sherman and Marian McClellan developed the oscillator, along with its cumulative cousin, the McClellan Summation Index. Both StockCharts’ ChartSchool entry and Investopedia’s explainer credit the pair. It was designed around US exchanges, the NYSE and Nasdaq, but Investopedia points out that the formula can be applied to any exchange or group of stocks. That’s what makes it usable here.
The raw input is net advances: the number of stocks that closed higher than the previous day minus the number that closed lower. If you’ve read our guide to the advance decline line, this is the same daily number. The A/D line keeps a running total of it. The McClellan oscillator does something different. It measures the momentum of that number.
ChartSchool’s comparison is a good way to think about it: the McClellan oscillator is to the A/D line what MACD is to a price chart. MACD subtracts a slower moving average of price from a faster one. The McClellan oscillator subtracts a slower moving average of net advances from a faster one.
The formula, step by step
There are two versions. The original works on raw net advances. The ratio-adjusted version, which StockCharts uses, divides net advances by the total of advancing plus declining stocks first. That matters because the number of listed stocks changes over the years. ChartSchool notes that the NYSE traded just over 2,000 stocks in 1990 and 1991 and between 3,000 and 3,600 a day from 1998 to 2010, so a raw reading of +200 meant something different in each period. Indian exchanges have added a lot of listings too, so we’d use the ratio-adjusted version.
Here is the ratio-adjusted calculation as ChartSchool lays it out:
- Ratio-adjusted net advances (RANA) = (Advances − Declines) ÷ (Advances + Declines). StockCharts multiplies the result by 1,000 to get whole numbers, so +753 means net advances of +75.3%.
- 19-day EMA = (Today’s RANA − Yesterday’s 19-day EMA) × 0.10 + Yesterday’s 19-day EMA.
- 39-day EMA = (Today’s RANA − Yesterday’s 39-day EMA) × 0.05 + Yesterday’s 39-day EMA.
- McClellan oscillator = 19-day EMA − 39-day EMA.
The 0.10 and 0.05 aren’t random. They’re the standard exponential moving average weights, 2 ÷ (19 + 1) and 2 ÷ (39 + 1). To get the averages started, Investopedia’s method is to take a simple average of the first 19 and 39 days and use those as the opening “yesterday” values. After that, each day just builds on the last.
Advances and declines here mean stocks that closed above or below their previous day’s close. Stocks that closed flat are left out of both counts.
A one-day calculation
Let’s do a single update by hand before looking at a full sequence. Say we track a 500-stock universe, and at yesterday’s close the 19-day EMA stood at +40 and the 39-day EMA at +10. That gives an oscillator reading of +30.
Today 380 stocks close higher, 110 close lower and 10 finish unchanged.
- RANA = (380 − 110) ÷ (380 + 110) = 270 ÷ 490 = 0.551, or 551 after multiplying by 1,000.
- New 19-day EMA = (551 − 40) × 0.10 + 40 = 91.1
- New 39-day EMA = (551 − 10) × 0.05 + 10 = 37.05
- Oscillator = 91.1 − 37.05 = 54.05
One strong day pushed the reading from +30 to about +54. Notice that the faster average moved by 51 points and the slower one by 27. That gap is the whole idea: a sudden swing in participation hits the short average first, and the oscillator widens.
An index can rise on the back of five stocks. The McClellan oscillator only rises when most of the market is rising with it.
Reading the three McClellan oscillator signals
Both sources describe the same three ways to use it. None of them work on their own, and we’ll come back to that.
1. Above or below zero
A positive reading means the 19-day EMA is above the 39-day EMA, so advancing stocks have the upper hand. A negative reading means decliners are in charge. ChartSchool says the indicator generally favours the bulls when positive and the bears when negative, and that it can stay on one side for weeks during a strong trend. Its NYSE example from late 2008 shows the oscillator holding positive for around six weeks while the NY Composite trended higher.
Crossing zero is the simplest signal, and also the noisiest. In a sideways market the line can flip back and forth every few sessions.
2. Divergence
This is the one most Nifty traders will find useful. A bearish divergence is when the index makes a higher high but the oscillator makes a lower high. Fewer stocks are carrying the rally. A bullish divergence is the reverse: the index makes a lower low but the oscillator makes a higher low, which means fewer stocks are joining the selling.
ChartSchool adds two filters that are worth taking seriously. The divergence should be sharp, with a clear difference between the two peaks or troughs, not a couple of points. And it should be confirmed by a strong move: a bearish divergence by a decisive drop into negative territory, a bullish one by a decisive move into positive territory. Without that, it says, most divergences don’t lead anywhere.
We’ve written about plenty of days on this site when large caps rallied and smallcaps sagged. The oscillator gives you a way to see whether that’s a one-day oddity or a pattern building over weeks.
3. Breadth thrusts
A breadth thrust is a sharp swing from deeply negative to strongly positive. ChartSchool’s usual definition is a move from below −50 to above +50, which is at least a 100-point thrust. Investopedia describes it the same way, as a move of 100 points or more from negative to positive. The idea is that a big, fast swing in participation often marks the start of a broader advance after a selloff.
ChartSchool is careful here. It says not every thrust leads to an extended rally, though most important lows are marked by a sharp surge in breadth. It also says a thrust is more convincing when a bullish divergence comes before it.
Worked example: a breadth thrust in a 500-stock universe
Here’s a nine-day sequence, again with invented numbers. We start with the 19-day EMA at −30 and the 39-day EMA at +5, so the oscillator is at −35. Each day, 490 of the 500 stocks move and 10 close flat. All values are rounded to one decimal.
| Day | Advances | Declines | RANA (×1,000) | 19-day EMA | 39-day EMA | Oscillator |
|---|---|---|---|---|---|---|
| 1 | 120 | 370 | −510.2 | −78.0 | −20.8 | −57.3 |
| 2 | 150 | 340 | −387.8 | −109.0 | −39.1 | −69.9 |
| 3 | 210 | 280 | −142.9 | −112.4 | −44.3 | −68.1 |
| 4 | 330 | 160 | 346.9 | −66.4 | −24.7 | −41.7 |
| 5 | 390 | 100 | 591.8 | −0.6 | 6.1 | −6.7 |
| 6 | 410 | 80 | 673.5 | 66.8 | 39.5 | 27.3 |
| 7 | 360 | 130 | 469.4 | 107.0 | 61.0 | 46.1 |
| 8 | 300 | 190 | 224.5 | 118.8 | 69.1 | 49.7 |
| 9 | 340 | 150 | 387.8 | 145.7 | 85.1 | 60.6 |
A few things stand out.
Day 3 is interesting. Decliners still beat advancers, 280 to 210, yet the oscillator ticked up from −69.9 to −68.1. Selling was getting less lopsided, and the indicator picked that up before the count itself turned positive.
Days 4 to 6 are the thrust. The 19-day EMA jumps more than 130 points in three sessions while the 39-day EMA lags, and the oscillator goes from −68.1 to +27.3.
Day 8 is a reminder of how the maths works. Advancers still beat decliners comfortably, 300 to 190, but RANA dropped sharply from the day before, so the oscillator barely moved. You don’t need a down day to stall the indicator. A less-good up day does it.
By day 9 the reading is +60.6, up from a low of −69.9 on day 2. That’s a swing of about 130 points from below −50 to above +50, which meets ChartSchool’s breadth thrust definition. In a real market, that’s the point where we’d start checking whether the Nifty and the broader indices are actually breaking out, rather than taking it on faith.
You don’t need a down day to stall the oscillator. A weaker up day is enough, because the indicator cares about how lopsided participation is, not just which side won.
Setting it up for Indian stocks
The ready-made readings ChartSchool describes, $NYMO for the NYSE and $NAMO for the Nasdaq, are US series. For Indian stocks you’ll usually build your own or rely on whatever your charting platform calculates. A few practical choices matter.
- Pick the universe on purpose. The whole exchange includes a long tail of thinly traded stocks that can swing the count. A defined basket, such as the Nifty 500 constituents, is cleaner and closer to what institutions actually trade. If you trade the Nifty 50 only, you can run the oscillator on its 50 members, but expect it to be jumpy with so few stocks.
- Use the ratio-adjusted version. Index baskets get rebalanced and new listings keep coming. Dividing by advances plus declines keeps readings comparable over time, which is the reason ChartSchool gives for adjusting.
- Be consistent with the data. Use the same end-of-day closes every day and keep your treatment of unchanged stocks fixed. Small inconsistencies compound because each EMA builds on the one before it.
- Give it a warm-up period. Since the EMAs start from simple averages, the first few weeks of readings aren’t reliable. Calculate a couple of months of history before you start reading signals.
If your platform doesn’t calculate it for Indian stocks, a spreadsheet with daily advance and decline counts works fine. The formula is four lines.
How traders combine it with price
Treat the oscillator as a second opinion on the index, not a trigger. Here’s how we’d use it in practice.
Confirming a breakout. If the Nifty clears a resistance level and the McClellan oscillator is positive and rising, most stocks are taking part. That’s a sturdier breakout than one where the index is up and the oscillator is drifting lower.
Warning on a tired rally. A string of index highs with the oscillator making lower highs is the classic bearish divergence. It doesn’t tell you when the top comes. It tells you to tighten stops, cut position sizes or be pickier about new longs.
Spotting a washout. After a sharp fall, a thrust from deep negative to strong positive is the signal ChartSchool links to many important lows. Pair it with price confirmation, like a higher low on the index or a close above a recent swing high, before acting.
The same logic applies to momentum tools on individual stocks. If you’re comfortable reading MACD histogram divergence on NSE charts, you already know most of what you need, because the oscillator borrows MACD’s structure. For the price side, our technical analysis guide for Indian stocks covers support, resistance and trend tools you can use for confirmation.
Where it lets you down
Both sources are frank about the weaknesses, and they line up with what you’d expect from any fast oscillator.
- Lots of signals, many false. Investopedia notes that thrusts, divergences and crossovers all happen fairly often and many don’t play out. ChartSchool calls it a rather volatile indicator that produces many potential signals.
- Whipsaws in choppy markets. In a range-bound phase the line can flip above and below zero repeatedly. Investopedia points out that you often only recognise the choppiness after several of those flips.
- Lower highs after a thrust are normal. ChartSchool’s March 2009 Nasdaq example shows the index kept climbing while the oscillator formed lower highs for weeks after a big thrust. Reading every lower high as a bearish divergence would have kept you out of that move.
- Your universe shapes the result. An oscillator built on all NSE stocks and one built on the Nifty 500 can disagree, sometimes for days. Neither is wrong. They measure different things.
Investopedia’s advice is to study how the indicator behaves across different market conditions before trading on it. We’d go further: backtest it on the exact universe you plan to use, with your own entry and exit rules, before putting money behind a signal.
Quick recap
The McClellan oscillator is the 19-day EMA minus the 39-day EMA of net advances, ideally ratio-adjusted. Positive readings mean broad buying, negative readings mean broad selling. The signals traders watch are zero-line crosses, divergences against the index and breadth thrusts from below −50 to above +50. It’s noisy, so use it to confirm or question what the Nifty’s price is telling you, not to place trades on its own.
Disclaimer: This article is for information and education only and is not investment advice or a recommendation to buy or sell any security. The formula, signal definitions and historical examples come from StockCharts’ ChartSchool and Investopedia, both linked above. All advance, decline and oscillator values in the worked examples are hypothetical numbers we made up and calculated for illustration; they are not real NSE or BSE data. Trading involves risk of loss; consult a SEBI-registered investment adviser before making investment decisions.

Leave a Reply
Join the conversation
Commenting is open to registered readers. Sign up with just your email — no password needed, and it takes under a minute.
Sign up to comment Log in