fintech-algorithms

Traditional McClellan Summation Index

Install and import

bash
npm install fintech-algorithms
ts
import { calculate } from "fintech-algorithms/market-breadth-and-internals/mcclellan-family/traditional-mcclellan-summation-index";

Signature

calculate(records, cutoff)

Worked example

executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.

Input

records
[
  {
    "session_date": "2026-01-02",
    "session_sequence": 1,
    "effective_at": "2026-01-02T21:00:00Z",
    "available_at": "2026-01-02T21:20:00Z",
    "revision": 0,
    "event_type": "upsert",
    "source_evidence_state": "ready",
    "venue_id": "SYNTH-X",
    "universe_id": "SYNTH-STABLE-200",
    "methodology_id": "close-vs-comparable-prior-close-v1",
    "calendar_id": "SYNTH-WEEKDAY",
    "volume_unit": "shares",
    "volume_adjustment_basis": "reported-unadjusted",
    "advances": 100
  },
  {
    "session_date": "2026-01-05",
    "session_sequence": 2,
    "effective_at": "2026-01-05T21:00:00Z",
    "available_at": "2026-01-05T21:20:00Z",
    "revision": 0,
    "event_type": "upsert",
    "source_evidence_state": "ready",
    "venue_id": "SYNTH-X",
    "universe_id": "SYNTH-STABLE-200",
    "methodology_id": "close-vs-comparable-prior-close-v1",
    "calendar_id": "SYNTH-WEEKDAY",
    "volume_unit": "shares",
    "volume_adjustment_basis": "reported-unadjusted",
    "advances": 100
  },
  {
    "session_date": "2026-01-06",
    "session_sequence": 3,
    "effective_at": "2026-01-06T21:00:00Z",
    "available_at": "2026-01-06T21:20:00Z",
    "revision": 0,
    "event_type": "upsert",
    "source_evidence_state": "ready",
    "venue_id": "SYNTH-X",
    "universe_id": "SYNTH-STABLE-200",
    "methodology_id": "close-vs-comparable-prior-close-v1",
    "calendar_id": "SYNTH-WEEKDAY",
    "volume_unit": "shares",
    "volume_adjustment_basis": "reported-unadjusted",
    "advances": 100
  }
]

Showing 3 of 60 elements.

cutoff
"2026-04-01T00:00:00Z"

Call

calculate(records, cutoff)

Returns

object with 8 fields: status, reason_codes, points, latest_oscillator, latest_index_value, ignored_future_records, seed_policy, initial_index

{
  "status": "resolved",
  "reason_codes": [],
  "points": [
    {
      "observation": 1,
      "input_value": 0,
      "fast_ema": null,
      "slow_ema": null,
      "oscillator": null,
      "index_value": null,
      "status": "warming_fast",
      "session_date": "2026-01-02"
    },
    {
      "observation": 2,
      "input_value": 0,
      "fast_ema": null,
      "slow_ema": null,
      "oscillator": null,
      "index_value": null,
      "status": "warming_fast",
      "session_date": "2026-01-05"
    },
    {
      "observation": 3,
      "input_value": 0,
      "fast_ema": null,
      "slow_ema": null,
      "oscillator": null,
      "index_value": null,
      "status": "warming_fast",
      "session_date": "2026-01-06"
    }
  ],
  "latest_oscillator": 0.8658494101161072,
  "latest_index_value": 1086.3098267234077,
  "ignored_future_records": 0,
  "seed_policy": "sma_19_39",
  "initial_index": 1000
}

Other exports

This module also exports transformRecord, calculateValues. Every module additionally exports run as an alias of its primary function, and a meta object carrying its catalog id, domain, family, shape and article URL.

Diagrams

Traditional McClellan Summation Index — family transform
Traditional McClellan Summation Index — worked state

Calculation flow

Traditional McClellan Summation Index calculation flow
flowchart TD
    A["Records available at knowledge cutoff"] --> B{"Contiguous, unique, ready evidence?"}
    B -->|No| C["Withhold path and report reason"]
    B -->|Yes| D["Apply Traditional McClellan Summation Index input transform"]
    D --> E["SMA-19 fast seed and 10% Trend"]
    D --> F["SMA-39 slow seed and 5% Trend"]
    E --> G{"Both states ready?"}
    F --> G
    G -->|No| H["Warm-up diagnostics"]
    G -->|Yes| I["Fast minus slow oscillator"]
    I --> J["Add to declared cumulative state"]
    J --> K["Provenance and current regime"]

How it works

This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.

Read the article →

References

  • Calculating the McClellan Oscillator — McClellan Financial Publications; Tom McClellan
  • The McClellan Oscillator and Summation Index — McClellan Financial Publications
  • A-D definition — Nasdaq, Inc.
  • Evidence reconciliation