OPEN-SOURCE SCRIPT

SMI Histogram State Visualization

91
Stochastic Momentum Index (SMI) – State Histogram

One issue I always had with the standard SMI was how difficult it can be to clearly distinguish EMA crosses, especially when the oscillator is compressed near overbought or oversold levels. Important information is there — it’s just not always easy to read quickly.
This script is my solution to that problem.
By transforming the SMI into a state-based histogram, momentum, exhaustion, and EMA crosses become visually obvious at a glance.

How It Works
The Stochastic Momentum Index (SMI) measures price position relative to the midpoint of its recent high–low range, which makes it:
symmetric around zero
smoother than a classic stochastic
well suited for momentum analysis
Instead of a traditional line oscillator, the SMI is displayed as a color-coded histogram, while an EMA of the SMI is used as a confirmation signal.

Color-Coded Momentum States
The histogram dynamically changes color based on momentum state and EMA position:
🔴 Red – Oversold & Below EMA
Strong bearish momentum, downtrend still intact.
🟠 Orange – Oversold & Above EMA
Bearish momentum weakening, early bullish reversal potential.
🟢 Green – Overbought & Above EMA
Strong bullish momentum, trend continuation.
🟡 Yellow – Overbought & Below EMA
Bullish momentum weakening, early bearish reversal potential.
Faded colors represent neutral or transition phases near the zero line.

Best Use Cases
Quickly identifying EMA crosses inside overbought / oversold zones
Spotting early reversals before price reacts
Confirming momentum continuation
Filtering noise in ranging markets
This indicator is non-repainting and works on all timeframes.
Inputs
%K Length – Lookback window used to define the price range
%D Length – Smoothing applied to the momentum calculation
EMA Length – Confirmation smoothing applied to the SMI

Notes
This indicator is intended as a visual momentum and confirmation tool, not a standalone trading system.
Always use it in confluence with price action, market structure, and proper risk management.

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.