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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.