McClellan Oscillator: The Breadth Data We Do Not Have, and the Crypto Analogue We Built
The McClellan Oscillator is a breadth indicator, and breadth is the one thing our engine structurally cannot compute. Saying so is more useful than pretending otherwise, so that is where this page starts.
Its definition is simple enough to state in a line: take the number of advancing issues minus declining issues each day, smooth that series with a 19-period exponential average and a 39-period one, and subtract the second from the first. Sherman and Marian McClellan published it in 1969 for the New York Stock Exchange. Our indicator engine ships the smoother and nothing else.
What breadth measures, and why it needs a market
An index can rise while most of its members fall. Breadth is the family of measures built to catch exactly that discrepancy, one member at a time.
Think of it as a headcount rather than a price. If an index gains 1% because four megacaps rallied and 380 constituents drifted lower, the price series looks healthy and the participation behind it is thin. A breadth reading exposes the gap because it weights every member the same — one vote each, regardless of size.
That definition carries a requirement most indicator descriptions gloss over: you need a defined membership list. Someone has to say which issues are in the market before you can count how many rose, and that list has to stay reasonably stable, or the count measures the list instead of the market.
What our engine ships, and what it cannot
Two separate absences, and only one of them is about code.
Searching every crate for mcclellan, advance_decline and summation_index returns zero hits. breadth returns eleven, and every one of them is broker-reconciliation prose — phrases like "recon-breadth" describing venue coverage in the IBKR and OANDA bridges, with nothing indicator-shaped anywhere near.
A deeper reason is structural. Every function in the single-series registry is handed one slice of bars through vectorize(&self, bars: &[Bar]), so a function there cannot see a universe even in principle. Cross-instrument work lives on a separate seam, and that seam holds pair functions taking exactly two series — still not a market.
Missing data is the bigger gap of the two. We do not carry equity breadth: no NYSE issue list, no daily advancing and declining counts, no membership history. Anything below that resembles the classic indicator is a crypto analogue built from our own universe, and it answers a different question.
The smoother, and the two averages it runs
Our crate does ship the exact kernel the oscillator is made of, twice.
How Vike computes it.batch_emaatbase.rs:43is a thin wrapper overmath.rs:200. That kernel writes a plain average of the firstnvalues at indexn − 1as its seed, then runsalpha × value[i] + (1 − alpha) × previouswithalpha = 2 ÷ (n + 1). Registered asemain the overlap family, default length 20, accepted range 1 to 1000. Before the seed index the output is nothing at all, not a partial value.
Run that kernel at 19 and at 39 over a breadth series, subtract, and you have the oscillator. The exponential moving average page covers the smoother on its own terms, and the structure will look familiar from the MACD, which is the identical two-average difference applied to price instead of to a headcount.
When I ported the kernel I checked it against the Python engine that the crate mirrors, at lengths 9, 19 and 39, across every symbol on our tape. All 1,073,305 values matched at 0.000e+00. Accumulate that difference and you have the McClellan Summation Index, which is one line of arithmetic on top.
Why the raw advance-decline count is unusable here
This is the trap that would have made every number on this page wrong.
Our coverage is not uniform. Across 3,286 calendar days, only 1,626 have at least 120 symbols reporting, and on those the count still climbs from 120 to 279 — a 2.3-fold change in the size of the universe. A raw advances − declines figure grows with participation whether or not anything changed about the market, and it duly does: the median absolute value runs 95 in the first half of the window and 152 in the second.
McClellan anticipated exactly this for a growing exchange and published a ratio-adjusted form, which divides by total issues and scales up. Measured the same way, that version reads 656.7 and then 712.1 — still drifting, far less. Every chart below plots the adjusted series, and the raw one is shown only to make the difference visible.
Scale changes too, and dramatically. Over the same days the ratio-adjusted oscillator spans −192.0 to +220.6, while the raw form spans −40.5 to +40.6. Anyone comparing an oscillator level against a threshold from a textbook is comparing two different units.
What the crypto analogue showed
Five real readings sit below, and three of them were followed by the opposite move.
Some findings first. Over 1,588 daily readings the line crossed zero 317 times — roughly once a week — which already argues against treating a crossing as rare. The deepest value on record, −192.0, printed on 2024-08-05, the day of the yen carry unwind; ten days later Bitcoin was 6.5% higher. The highest, +220.6, came on 2023-01-14, and that one did continue.
Then the number that matters most. Of 314 zero crossings with enough forward data, the proxy moved the same way over the following ten days on 157 and the other way on 157. An exact split, unrounded. I have seen no cleaner demonstration that a breadth crossing describes the past and nothing else.
None of this says the original indicator is worthless on equities. It says our version measures a universe of crypto pairs with unstable membership, and it would be dishonest to import a stock-market interpretation onto it.
Frequently asked questions
What is a McClellan Oscillator reading of zero? Only that the fast and slow averages of breadth are equal. On our data the line crossed zero every five days on average, so the state itself is unremarkable.
How is the McClellan Summation Index built? By accumulating the oscillator. No separate function is needed — add each value to the one before it and you have the series.
Can this be computed for crypto? An analogue can, and this page publishes one. It measures something else, though: our universe changes size by a factor of 2.3 across the window, and an exchange listing does not.
Why 19 and 39? Those are McClellan's own lengths, corresponding to 10% and 5% smoothing constants. Every figure here uses them unchanged rather than searching for something that scores better.
Does Vike ship a breadth indicator? No. The registry holds no breadth entry, the crate contains no advance-decline logic, and we carry no equity breadth data — the smoother is ours, the rest is arithmetic in a script.
This is educational material, not financial advice. Every figure on this page was measured on bars that have already closed, past behavior generalizes poorly to future bars, and trading carries real risk of loss — size any position so that being wrong stays survivable.