OPEN-SOURCE SCRIPT
Mis à jour

Hindenburg Omen [Miekka Method]

284
Hindenburg Omen [Miekka Method]

This indicator implements Jim Miekka's original Hindenburg Omen methodology, correcting several errors found in most public implementations. It is a rewrite of QuantNomad's v4 Hindenburg Omen indicator, updated to Pine Script v6 with structural corrections to match Miekka's published specification.


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


WHAT THE HINDENBURG OMEN IS

The Hindenburg Omen is a market breadth indicator that flags periods of elevated crash risk. It detects a specific divergence condition: when an unusually large percentage of NYSE-listed stocks are simultaneously hitting 52-week highs AND 52-week lows. Under normal conditions, the market moves with some degree of uniformity. When both extremes spike at once during an uptrend, it suggests internal fracturing that has historically preceded significant drawdowns.

The indicator 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 complications from subsequent surgery. While recovering, he began studying the markets by listening to financial broadcasts. Because he could not see, he 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, who had a background in advertising and knew the value of a strong brand. Gammage was also familiar with Bill Ohama's "Titanic Syndrome," another indicator based on new highs and new lows data.

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


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


HOW THIS IMPLEMENTATION DIFFERS FROM MOST

Most publicly available versions of the Hindenburg Omen contain errors that have been copied from source to source for years. This version corrects four material deviations from Miekka's specification:

1. Threshold
Miekka specified 2.8% as the minimum percentage of NYSE issues that must be hitting new 52-week highs and lows simultaneously. Most implementations incorrectly use 2.2%. This script defaults to 2.8% but remains configurable.

2. Denominator
Miekka defined the threshold as a percentage of advances plus declines on the same day. Most implementations incorrectly use total issues traded (advances + declines + unchanged). An older version of the indicator used 2.5% of total issues, which may be the source of this confusion. This script uses advances + declines per Miekka's final specification.

3. McClellan Oscillator role
This is the most significant correction. Most implementations treat a negative McClellan Oscillator as one of several conditions that must all fire on the same bar. Miekka's actual design is a two-phase system:
Phase 1 (Trigger): Breadth divergence and an uptrend must fire on the same bar, opening a 30-trading-day signal window.
Phase 2 (Activation): Within that window, the omen is activated when the MCO is negative and deactivated when it turns positive.
The MCO is a gate, not a co-equal trigger.

4. High/Low ratio filter
Many implementations include a condition requiring that new highs cannot exceed twice the number of new lows. This does not appear in Miekka's published methodology and has been removed.


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


HOW TO READ THE CHART

Red triangle above a bar: A trigger has fired (breadth divergence + uptrend confirmed on that bar). This opens a 30-trading-day signal window.

Dark maroon background: The omen is active. You are inside a signal window 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: A signal window is open but the MCO has turned positive, temporarily deactivating the omen. The window has not expired, so if the MCO dips negative again before the 30 days are up, the omen reactivates and the background returns to maroon.

No background: Either no trigger has fired recently or the 30-day window has expired.

A floating label on the last bar shows the current state of all conditions, the MCO value, and how many bars remain in any active window.

Cluster interpretation: A single trigger in isolation is weaker than multiple triggers firing within a short timeframe. If you see repeated triggers clustering within a few weeks, that is historically a stronger warning than a single occurrence.


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


INPUTS

New Highs/Lows Threshold % — Minimum percentage of NYSE advances + declines hitting new 52-week highs and lows. Default 2.8% per Miekka. Some analysts use 2.2%.
Positive Trend Lookback — Number of trading days used to confirm the NYSE Composite is in an uptrend. Default 50.
Signal Window — Number of trading days the signal window remains open after a trigger. Default 30.


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


ALERTS

Two alert conditions are available:
Hindenburg Trigger: Fires when the breadth divergence and uptrend conditions are met on the same bar.
Hindenburg Active: Fires when the omen is active (inside signal window with negative MCO).


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


LIMITATIONS

The Hindenburg Omen has a meaningful false positive rate. It fires more often than crashes actually occur. It should be used as one input in a broader risk assessment framework, not as a standalone trading signal. ETF proliferation on the NYSE has also introduced structural noise into the new highs/lows data, which can produce spurious triggers.


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


CREDITS

Originally based on QuantNomad's Hindenburg Omen v4 indicator. Rewritten for Pine Script v6 with structural corrections to align with Miekka's published methodology.

Primary sources:
• Greg Morris, The Complete Guide to Market Breadth Indicators (contains material written directly by Miekka)
• Adaptiv Investments writeup documenting Miekka's formula
• Tom McClellan's commentary at McClellan Financial Publications
Notes de version
Paste this into the release notes field:

DATA FEED MIGRATION AND RELIABILITY UPDATE
This update corrects a data feed issue that caused the indicator to silently stop detecting triggers on recent bars.
Feed migration: The NYSE advance and decline inputs have been migrated from USI:ADV and USI:DECL to INDEX:ADVN and INDEX:DECN. The USI feeds, inherited from the original v4 base script, stopped updating reliably. The INDEX feeds also match the universe of the INDEX:MAHN and INDEX:MALN new highs and lows feeds already used by this script, so the numerator and denominator of the threshold calculation now draw from a consistent NYSE universe.
Data integrity guard: All five data feeds are now checked for missing values on every bar. If any feed returns no data, trigger conditions are explicitly suppressed and the status label displays DATA UNAVAILABLE in gray rather than failing silently. Future feed outages will be visible on the chart instead of appearing as an absence of signals.
Diagnostics: New highs percentage, new lows percentage, the McClellan Oscillator value, and the advances plus declines total are now exposed in the data window for verification on any historical bar.
Note on historical signals: Because the McClellan Oscillator EMAs now compute over the corrected feeds, trigger and activation history may shift marginally on dates where the old feeds had gaps. No changes were made to the methodology itself. Thresholds, denominators, the two-phase trigger and MCO gate structure, and all defaults remain as specified by Miekka.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.