OPEN-SOURCE SCRIPT
ueuito MACD Custom PRO

Just another MACD with something else...
Description
MACD Custom PRO is an advanced and highly configurable momentum indicator built around the classic Moving Average Convergence Divergence (MACD) concept. The indicator extends the traditional MACD framework by integrating additional filters, visual enhancements, and signal validation tools designed to help traders better interpret market momentum, volatility conditions, and trend alignment.
The indicator calculates the MACD line using the difference between two exponential moving averages of price: a fast EMA and a slow EMA. A signal line is then derived as an exponential moving average of the MACD line. The histogram represents the difference between the MACD line and the signal line and serves as a visual representation of momentum strength and direction.
The indicator introduces several configurable components that enhance the traditional MACD approach.
MACD Core Structure
The core of the indicator is the traditional MACD calculation:
Fast EMA – default length 12
Slow EMA – default length 26
Signal EMA – default length 9
The MACD line represents the difference between the fast and slow EMA. The signal line smooths the MACD values and helps identify crossovers. The histogram represents the distance between the two lines and visually highlights momentum expansion or contraction.
Histogram Visualization Modes
The histogram can be displayed using multiple color modes that provide different interpretations of momentum.
Classic MACD Mode
In the default configuration, the histogram uses four colors to represent momentum behavior relative to the zero line:
Positive and rising momentum
Positive but falling momentum
Negative but rising momentum
Negative and falling momentum
This visualization helps traders quickly identify momentum acceleration or deceleration.
Histogram Moving Average Mode
An optional moving average of the histogram can be enabled. This moving average can be calculated using one of four selectable methods:
EMA
SMA
WMA
RMA
When enabled, the histogram moving average acts as a smoothing layer that can help identify changes in momentum structure earlier than traditional MACD signals.
The histogram moving average can also dynamically change color depending on whether the histogram is above or below the average, helping traders visualize shifts in momentum direction.
Momentum Color Mode
A momentum-based color mode is available that classifies histogram bars relative to the histogram moving average and their direction of movement.
This produces four states of momentum:
Histogram above its average and rising (strong bullish momentum)
Histogram above its average but falling (momentum weakening)
Histogram below its average but rising (potential reversal or recovery)
Histogram below its average and falling (strong bearish momentum)
This mode can help traders identify early shifts in momentum before traditional MACD crossovers occur.
ATR Volatility Filter
The indicator includes an optional volatility filter based on the Average True Range (ATR).
ATR is used to determine whether market volatility is sufficient to validate trading signals. When the filter is enabled, signals will only be considered valid when the ATR exceeds a moving average of the ATR multiplied by a configurable threshold.
This helps reduce false signals during low-volatility market conditions where MACD crossovers often become unreliable.
Zero Line Filter
An optional zero-line filter can be applied to MACD signals.
When enabled:
Bullish signals are only valid when the MACD line is above zero.
Bearish signals are only valid when the MACD line is below zero.
This filter ensures that trades are aligned with the broader momentum direction.
Trend Filter Using EMA
The indicator can optionally incorporate a trend filter based on a long-term exponential moving average of price.
When enabled:
Bullish signals are allowed only when price is above the trend EMA.
Bearish signals are allowed only when price is below the trend EMA.
This feature helps align momentum signals with the broader market trend.
MACD Line Direction Coloring
The MACD line and signal line dynamically change color depending on whether they are rising or falling. This visual feedback provides an additional layer of momentum interpretation and allows traders to see shifts in direction more easily.
MACD Cross Markers
Optional visual markers can be displayed whenever the MACD line crosses the signal line.
The shape and color of these markers can be customized, allowing traders to highlight key crossover events directly on the indicator panel.
Histogram Moving Average Cross Signals
The indicator also detects crossovers between the histogram and its moving average. These events often occur earlier than MACD line crossovers and can provide early warnings of momentum shifts.
Alert conditions are included for these events, allowing users to create automated notifications when they occur.
Trend Background Visualization
A background coloring feature can be enabled to visually represent strong trend alignment.
The background turns bullish when:
MACD is above the signal line and
The histogram is above its moving average.
The background turns bearish when:
MACD is below the signal line and
The histogram is below its moving average.
This feature helps traders visually identify sustained momentum environments.
Possible Use Cases
This indicator can be applied in multiple trading approaches.
Momentum trading
Traders can use the histogram momentum coloring to detect strengthening or weakening momentum and enter trades during early momentum expansion.
Trend-following strategies
By enabling the trend filter and zero-line filter, the indicator can be used to identify MACD signals that align with broader market direction.
Volatility-aware trading
The ATR filter can help avoid entering trades during periods of insufficient volatility, improving signal quality.
Early momentum detection
Histogram moving average crossovers can serve as an early signal that momentum is shifting before traditional MACD crossovers occur.
Multi-filter signal confirmation
By combining ATR filtering, trend filtering, and zero-line filtering, traders can significantly reduce noise and focus on higher probability setups.
Timeframe flexibility
The indicator can be applied across multiple timeframes and markets including stocks, cryptocurrencies, forex, and indices.
Risk Disclaimer
Trading financial markets involves substantial risk and may not be suitable for all investors. Indicators and technical analysis tools are designed to assist in decision-making but they do not guarantee profitable results. Market conditions can change rapidly and no indicator can predict price movements with certainty. Traders should always apply proper risk management, conduct their own analysis, and understand that past performance does not guarantee future outcomes.
Description
MACD Custom PRO is an advanced and highly configurable momentum indicator built around the classic Moving Average Convergence Divergence (MACD) concept. The indicator extends the traditional MACD framework by integrating additional filters, visual enhancements, and signal validation tools designed to help traders better interpret market momentum, volatility conditions, and trend alignment.
The indicator calculates the MACD line using the difference between two exponential moving averages of price: a fast EMA and a slow EMA. A signal line is then derived as an exponential moving average of the MACD line. The histogram represents the difference between the MACD line and the signal line and serves as a visual representation of momentum strength and direction.
The indicator introduces several configurable components that enhance the traditional MACD approach.
MACD Core Structure
The core of the indicator is the traditional MACD calculation:
Fast EMA – default length 12
Slow EMA – default length 26
Signal EMA – default length 9
The MACD line represents the difference between the fast and slow EMA. The signal line smooths the MACD values and helps identify crossovers. The histogram represents the distance between the two lines and visually highlights momentum expansion or contraction.
Histogram Visualization Modes
The histogram can be displayed using multiple color modes that provide different interpretations of momentum.
Classic MACD Mode
In the default configuration, the histogram uses four colors to represent momentum behavior relative to the zero line:
Positive and rising momentum
Positive but falling momentum
Negative but rising momentum
Negative and falling momentum
This visualization helps traders quickly identify momentum acceleration or deceleration.
Histogram Moving Average Mode
An optional moving average of the histogram can be enabled. This moving average can be calculated using one of four selectable methods:
EMA
SMA
WMA
RMA
When enabled, the histogram moving average acts as a smoothing layer that can help identify changes in momentum structure earlier than traditional MACD signals.
The histogram moving average can also dynamically change color depending on whether the histogram is above or below the average, helping traders visualize shifts in momentum direction.
Momentum Color Mode
A momentum-based color mode is available that classifies histogram bars relative to the histogram moving average and their direction of movement.
This produces four states of momentum:
Histogram above its average and rising (strong bullish momentum)
Histogram above its average but falling (momentum weakening)
Histogram below its average but rising (potential reversal or recovery)
Histogram below its average and falling (strong bearish momentum)
This mode can help traders identify early shifts in momentum before traditional MACD crossovers occur.
ATR Volatility Filter
The indicator includes an optional volatility filter based on the Average True Range (ATR).
ATR is used to determine whether market volatility is sufficient to validate trading signals. When the filter is enabled, signals will only be considered valid when the ATR exceeds a moving average of the ATR multiplied by a configurable threshold.
This helps reduce false signals during low-volatility market conditions where MACD crossovers often become unreliable.
Zero Line Filter
An optional zero-line filter can be applied to MACD signals.
When enabled:
Bullish signals are only valid when the MACD line is above zero.
Bearish signals are only valid when the MACD line is below zero.
This filter ensures that trades are aligned with the broader momentum direction.
Trend Filter Using EMA
The indicator can optionally incorporate a trend filter based on a long-term exponential moving average of price.
When enabled:
Bullish signals are allowed only when price is above the trend EMA.
Bearish signals are allowed only when price is below the trend EMA.
This feature helps align momentum signals with the broader market trend.
MACD Line Direction Coloring
The MACD line and signal line dynamically change color depending on whether they are rising or falling. This visual feedback provides an additional layer of momentum interpretation and allows traders to see shifts in direction more easily.
MACD Cross Markers
Optional visual markers can be displayed whenever the MACD line crosses the signal line.
The shape and color of these markers can be customized, allowing traders to highlight key crossover events directly on the indicator panel.
Histogram Moving Average Cross Signals
The indicator also detects crossovers between the histogram and its moving average. These events often occur earlier than MACD line crossovers and can provide early warnings of momentum shifts.
Alert conditions are included for these events, allowing users to create automated notifications when they occur.
Trend Background Visualization
A background coloring feature can be enabled to visually represent strong trend alignment.
The background turns bullish when:
MACD is above the signal line and
The histogram is above its moving average.
The background turns bearish when:
MACD is below the signal line and
The histogram is below its moving average.
This feature helps traders visually identify sustained momentum environments.
Possible Use Cases
This indicator can be applied in multiple trading approaches.
Momentum trading
Traders can use the histogram momentum coloring to detect strengthening or weakening momentum and enter trades during early momentum expansion.
Trend-following strategies
By enabling the trend filter and zero-line filter, the indicator can be used to identify MACD signals that align with broader market direction.
Volatility-aware trading
The ATR filter can help avoid entering trades during periods of insufficient volatility, improving signal quality.
Early momentum detection
Histogram moving average crossovers can serve as an early signal that momentum is shifting before traditional MACD crossovers occur.
Multi-filter signal confirmation
By combining ATR filtering, trend filtering, and zero-line filtering, traders can significantly reduce noise and focus on higher probability setups.
Timeframe flexibility
The indicator can be applied across multiple timeframes and markets including stocks, cryptocurrencies, forex, and indices.
Risk Disclaimer
Trading financial markets involves substantial risk and may not be suitable for all investors. Indicators and technical analysis tools are designed to assist in decision-making but they do not guarantee profitable results. Market conditions can change rapidly and no indicator can predict price movements with certainty. Traders should always apply proper risk management, conduct their own analysis, and understand that past performance does not guarantee future outcomes.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.