McClellanSummationIndex
The McClellan Summation Index — the running cumulative sum of the McClellan Oscillator. Where the oscillator measures breadth momentum, the summation index integrates it into a longer-term breadth trend.
Quick reference
| Item | Value |
|---|---|
| Family | Market Breadth |
| Input type | CrossSection — the per-symbol state of the whole universe |
| Output type | f64 (cumulative; may be negative) |
| Output range | unbounded; centred on 0 |
| Default parameters | none (fixed 19/39 smoothing) |
| Warmup period | 1 |
| Interpretation | Long-term breadth trend |
Formula
osc = McClellanOscillator(tick) # 19/39 EMA spread of ratio-adjusted net advances
sum = sum + osc # cumulativeThe summation index embeds a McClellanOscillator and adds its value on every tick. Because the oscillator seeds to 0.0 on the first tick, the summation index also starts at 0.0 and is defined from the first update. It behaves like a slow, smoothed advance/decline line. Stateful and O(universe size) per tick. See crates/wickra-core/src/indicators/mcclellan_summation_index.rs.
Parameters
None — inherits the oscillator's fixed 19/39 smoothing. Construct with McClellanSummationIndex::new().
| Parameter | Type | Default | Source |
|---|---|---|---|
| — | — | — | None. |
Inputs / Outputs
Indicator<Input = CrossSection, Output = f64>:
use wickra::{CrossSection, Indicator, McClellanSummationIndex};
const _: fn(&mut McClellanSummationIndex, CrossSection) -> Option<f64> =
<McClellanSummationIndex as Indicator>::update;The bindings pass a tick as four equal-length parallel arrays:
- Python:
update(change, volume, new_high, new_low);batch(...)returns a 1-Dndarray. - Node:
update(change, volume, newHigh, newLow);batchreturnsnumber[]. - WASM:
update(change, volume, newHigh, newLow)only; flag arrays are numeric.
Warmup
warmup_period() == 1; the embedded oscillator seeds on tick one, so the summation index is 0.0 on the first tick and defined thereafter (tests accessors_and_metadata, first_tick_starts_at_zero).
Edge cases
- First tick. The oscillator seeds to
0.0, so the index starts at0.0(testfirst_tick_starts_at_zero). - Accumulation. The index adds each oscillator value (test
accumulates_the_oscillator, worked values0 -> -50 -> -117.5). - Reset.
reset()clears both the index and the embedded oscillator, which re-seeds on the next tick (testreset_clears_state). - Invalid / empty universe. Rejected at construction by
CrossSection::new.
Examples
Rust
use wickra::{CrossSection, Indicator, McClellanSummationIndex, Member};
let mut msi = McClellanSummationIndex::new();
let tick = CrossSection::new(
vec![
Member::new(1.0, 10.0, false, false),
Member::new(-1.0, 10.0, false, false),
],
0,
)?;
// First tick: oscillator seeds to 0, so the summation index is 0.
assert_eq!(msi.update(tick), Some(0.0));Python
import wickra as ta
msi = ta.McClellanSummationIndex()
print(msi.update([1.0, -1.0], [10.0, 10.0], [False, False], [False, False]))
# 0.0 (seed)Node
const { McClellanSummationIndex } = require('wickra');
const msi = new McClellanSummationIndex();
console.log(msi.update([1.0, -1.0], [10, 10], [false, false], [false, false]));
// 0Streaming
import wickra as ta
msi = ta.McClellanSummationIndex()
flags = [False] * 4
vol = [10.0] * 4
print(msi.update([1.0, 1.0, 1.0, -1.0], vol, flags, flags)) # 0.0 (osc 0)
print(msi.update([-1.0, -1.0, -1.0, 1.0], vol, flags, flags)) # -50.0 (osc -50)
print(msi.update([1.0, 1.0, -1.0, -1.0], vol, flags, flags)) # -117.5 (osc -67.5)Interpretation
The Summation Index is the McClellan trend gauge.
- Above / below zero. Sustained positive readings mark a bull breadth regime; sustained negative, a bear regime.
- Zero-line crosses. A cross of zero is read as a major breadth trend change.
- Extremes. Very high or low levels mark overbought/oversold breadth that often precedes a turn.
Common pitfalls
- Path-dependent. Like any cumulative series, the absolute level depends on the starting point and the history fed in — compare slopes and zero-crosses, not raw levels across runs.
- Ratio-adjusted base. Inherits the oscillator's RANA basis, so it is universe- size independent but will not match a raw-net Summation Index value-for-value.
- Universe must be stable. Changing membership distorts the underlying RANA.
References
- McClellan, S. & McClellan, M. Patterns for Profit — the McClellan Oscillator and Summation Index.
See also
- Indicator-McClellanOscillator — the oscillator this index accumulates.
- Indicators-Overview — the full taxonomy.