OPEN-SOURCE SCRIPT
Indexed MACD Oscillator

Indexed MACD Oscillator — A normalized version of the standard MACD histogram, rescaled to always oscillate between 0 and 100 (rather than fluctuating in raw price-difference units, which vary a lot by symbol/timeframe). It calculates the standard MACD (12/26 EMA) and signal line (9-period EMA of MACD), takes the histogram (MACD − Signal), then min-max normalizes it using the highest and lowest histogram values over the trailing 100 bars. The result: 0 represents the most bearish momentum reading in the lookback window, 100 represents the most bullish, and the two gray reference lines mark those bounds.
This effectively turns MACD histogram into an oscillator similar in spirit to Stochastic or RSI — useful for comparing momentum extremes across different symbols on a consistent 0–100 scale, since raw MACD histogram values aren't comparable between, say, a $30 stock and a $3,000 stock.
One thing worth flagging for the description/documentation: since the normalization uses a rolling 100-bar high/low, the 0 and 100 levels are relative to recent history, not fixed absolute thresholds — a reading of 100 today doesn't necessarily mean the same momentum strength as a 100 from three months ago, since the window is constantly sliding. Might be worth a line in the description clarifying that it's a relative momentum extremity measure, not an absolute one, so users don't misread it like a fixed RSI-style overbought/oversold level.
This effectively turns MACD histogram into an oscillator similar in spirit to Stochastic or RSI — useful for comparing momentum extremes across different symbols on a consistent 0–100 scale, since raw MACD histogram values aren't comparable between, say, a $30 stock and a $3,000 stock.
One thing worth flagging for the description/documentation: since the normalization uses a rolling 100-bar high/low, the 0 and 100 levels are relative to recent history, not fixed absolute thresholds — a reading of 100 today doesn't necessarily mean the same momentum strength as a 100 from three months ago, since the window is constantly sliding. Might be worth a line in the description clarifying that it's a relative momentum extremity measure, not an absolute one, so users don't misread it like a fixed RSI-style overbought/oversold level.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.