OPEN-SOURCE SCRIPT

Hindenburg Omen [Consensus]

373
Hindenburg Omen [Miekka Method] - Multi-Universe Consensus

This indicator runs Jim Miekka's two-phase Hindenburg Omen methodology independently across multiple market universes (NYSE, S&P 500, and optionally NASDAQ) and only signals when two or more universes agree. Cross-universe consensus filters out noise specific to any single exchange, producing fewer but higher-conviction warnings of genuine broad-market fracturing.

This is the third in a series of Hindenburg Omen indicators built on Miekka's original specification. The first corrects the widely misimplemented NYSE version. The second adapts it to the S&P 500 to avoid ETF noise. This version combines both (and optionally NASDAQ) into a consensus framework.


═══════════════════════════════════════════════════════════════════


WHY CONSENSUS

Every single-universe breadth indicator has blind spots:

NYSE is polluted by ETFs, closed-end funds, preferred shares, and structured products that inflate the new highs and new lows counts with cross-asset noise. A bond ETF hitting a new low while equities rally is not the breadth divergence Miekka intended to detect.

S&P 500 is curated and clean (no ETFs, no structured products), but it only covers ~503 large-cap names. It misses mid-cap and small-cap weakness, and its small universe means a handful of stocks can push the percentages around.

NASDAQ skews heavily toward technology and growth. Breadth divergence on NASDAQ alone may reflect sector rotation rather than broad-market stress.

When two or more of these universes independently show breadth divergence during an uptrend, the signal is far more likely to represent genuine market-wide fracturing rather than an artifact of one exchange's composition. This is also philosophically consistent with Miekka's own emphasis on cluster confirmation as a stronger warning than a single signal.


═══════════════════════════════════════════════════════════════════


HOW IT WORKS

The indicator applies Miekka's two-phase methodology independently to each enabled universe:

Phase 1: Trigger (per universe)
Two conditions must fire on the same bar to open a 30-trading-day signal window for that universe:
Breadth divergence: Both new 52-week highs and new 52-week lows must each exceed a threshold percentage of the universe's issue count.
Uptrend: The universe's benchmark index must be at or above its value from 50 trading days ago.

Each universe has its own threshold and denominator:
NYSE: 2.8% of advances + declines (per Miekka's original specification)
S&P 500: 4.7% of ~503 fixed constituent count
NASDAQ: 2.8% of ~3,300 estimated composite count

Phase 2: Activation (global)
The indicator counts how many universes currently have open signal windows. When that count meets or exceeds the minimum consensus threshold (default: 2) AND the McClellan Oscillator is negative, the omen is active.

The MCO is computed from NYSE breadth data globally, as TradingView does not provide per-universe advance/decline feeds for the S&P 500 or NASDAQ. It acts as a sentiment gate within the consensus window, not a co-equal trigger condition.


═══════════════════════════════════════════════════════════════════


HOW TO READ THE CHART

Red "CONSENSUS" triangle above a bar: Multiple universes triggered on the same bar, meeting the consensus threshold. This is the strongest single-bar signal.

Gray dot above a bar: A single universe triggered but consensus was not reached. Provides context on which universes are showing stress even when the full consensus signal has not fired.

Dark maroon background: The omen is active. Enough universes have overlapping open signal windows and the McClellan Oscillator is negative. Per Miekka, this is the state where traders should consider going short or exiting long positions.

Light orange background: Enough universes have overlapping windows (consensus reached) but the MCO has turned positive, temporarily deactivating the omen. If the MCO dips negative again before the windows expire, the omen reactivates.

No background: Either not enough universes have open windows or all windows have expired.

The floating label on the last bar shows the full status of each universe: whether its window is open, its current new highs/lows percentages versus its threshold, the MCO reading, and the consensus score.

Important: Consensus is scored at the window level, not the trigger level. The indicator asks "how many universes currently have an open 30-day signal window?" rather than "how many triggered on this exact bar?" Triggers across universes will not necessarily land on the same day, but overlapping windows indicate the same underlying stress.


═══════════════════════════════════════════════════════════════════


INPUTS

General
Positive Trend Lookback — Trading days used to confirm the uptrend condition for each universe. Default 50.
Signal Window — Trading days each universe's signal window remains open after a trigger. Default 30.
Minimum Universes for Consensus — How many universes must have overlapping open windows before the consensus signal fires. Default 2. Range 1-3. Set to 1 to see individual universe signals without consensus filtering.

NYSE
Enable NYSE — Toggle this universe on or off. Default on.
NYSE Threshold % — Minimum percentage of advances + declines hitting new 52-week highs and lows. Default 2.8% per Miekka.

S&P 500
Enable S&P 500 — Toggle this universe on or off. Default on.
S&P 500 Threshold % — Minimum percentage of S&P 500 constituents hitting new 52-week highs and lows. Default 4.7%.
S&P 500 Constituent Count — Denominator for percentage calculation. Default 503.

NASDAQ (Unverified Symbols)
Enable NASDAQ — Toggle this universe on or off. Default off. The data symbols `INDEX:MAHQ` and `INDEX:MALQ` are unverified on TradingView. Enable this only after confirming these symbols return valid data on your TradingView plan. If they return no data, the NASDAQ universe will not contribute to consensus.
NASDAQ Threshold % — Minimum percentage of NASDAQ composite issues. Default 2.8%.


═══════════════════════════════════════════════════════════════════


ALERTS

Two alert conditions are available:
Consensus Trigger: Fires when enough universes trigger on the same bar to meet the consensus threshold.
Consensus Active: Fires when the consensus omen is active (enough overlapping windows + negative MCO).


═══════════════════════════════════════════════════════════════════


DATA FEEDS

NYSE
• `INDEX:MAHN` — NYSE new 52-week highs count
• `INDEX:MALN` — NYSE new 52-week lows count
• `USI:ADV` — NYSE advancing issues (also used for global MCO)
• `USI:DECL` — NYSE declining issues (also used for global MCO)
• `NYA` — NYSE Composite Index

S&P 500
• `INDEX:MAHP` — S&P 500 new 52-week highs count
• `INDEX:MALP` — S&P 500 new 52-week lows count
• `SP:SPX` — S&P 500 Index

NASDAQ
• `INDEX:MAHQ` — NASDAQ new 52-week highs count (unverified)
• `INDEX:MALQ` — NASDAQ new 52-week lows count (unverified)
• `NASDAQ:IXIC` — NASDAQ Composite Index


═══════════════════════════════════════════════════════════════════


LIMITATIONS

False positives: Even with consensus filtering, the Hindenburg Omen can fire without a subsequent decline. It should be used as one input in a broader risk assessment framework, not as a standalone trading signal.

Hybrid MCO: The McClellan Oscillator is computed from NYSE breadth data and applied globally across all universes. No per-universe MCO is available on TradingView.

NASDAQ symbols unverified: The `INDEX:MAHQ` and `INDEX:MALQ` symbols follow the observed naming convention but have not been confirmed to return valid data. NASDAQ is disabled by default for this reason.

Thresholds not backtested: The default thresholds (2.8% NYSE, 4.7% S&P 500, 2.8% NASDAQ) are starting points. The NYSE value is Miekka's original. The S&P 500 value is empirically chosen for the smaller, curated universe. Users should evaluate signal quality and adjust.

Data availability: The breadth data feeds have limited historical depth on TradingView. The indicator will not produce signals prior to the start of these feeds (approximately 2015 for most).

Not investment advice: This indicator is a technical analysis tool. It does not constitute financial advice. Always conduct your own research and consult qualified professionals before making investment decisions.


═══════════════════════════════════════════════════════════════════


BACKGROUND

The Hindenburg Omen was developed by James R. Miekka in 1995 as a modified and restricted version of work originally published by Martin Zweig and later tweaked by Gerald Appel. It also draws on Norman G. Fosback's High Low Logic Index. Miekka was a high-school physics teacher who lost his eyesight after a laboratory explosion and worked almost entirely with formulas rather than charts. He published the indicator through his newsletter, the Sudbury Bull and Bear Report. The name was suggested by Kennedy Gammage, publisher of The Richland Report. Miekka passed away in 2014.

Claims that the Hindenburg Omen "predicted the crash of 1987" are retroactive backtests. Miekka did not develop the indicator until 1995.


═══════════════════════════════════════════════════════════════════


CREDITS

Part of the Hindenburg Omen [Miekka Method] series. The NYSE version corrects structural errors in most public implementations. The S&P 500 version addresses ETF noise. This consensus version combines multiple universes to reduce false positives.

Originally based on QuantNomad's Hindenburg Omen v4 indicator. Rewritten for Pine Script v6.

Primary sources:
• Greg Morris, The Complete Guide to Market Breadth Indicators (contains material written directly by Miekka)
• Adaptiv Investments writeup documenting Miekka's original formula
• Tom McClellan's commentary at McClellan Financial Publications

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.