OPEN-SOURCE SCRIPT
MACD Scaled Overlay

█ OVERVIEW
The "MACD Scaled Overlay" indicator is an advanced version of the classic MACD (Moving Average Convergence Divergence) oscillator that displays signals directly on the price chart. Instead of a traditional separate panel, the MACD line, signal line, and histogram are scaled and overlaid on the price chart, making it easier to identify key price levels and potential reversal points. The indicator also supports the detection of divergences (regular and hidden) and offers extensive customization options, such as adjusting colors, line thickness, and enabling/disabling visual elements.
█ CONCEPTS
The "MACD Scaled Overlay" indicator is designed to simplify trend and reversal analysis by integrating MACD signals with the price chart. The MACD Scaled Overlay is scaled relative to the average candle range, allowing the lines and histogram to dynamically adjust to market volatility. Additionally, the indicator enables the detection of divergences (bullish and bearish, both regular and hidden) based on the traditional MACD histogram (before scaling), ensuring consistency with classic divergence analysis. The indicator is most effective when combined with other technical analysis tools, such as Fibonacci levels, pivot points, or trend lines.
█ MACD Calculations and Scaling
The indicator is based on the classic MACD formula, which includes:
-MACD Line: The difference between the fast EMA (default: 12) and the slow EMA (default: 26).
-Signal Line: The EMA of the MACD line (default: 9).
-Histogram: The difference between the MACD line and the signal line.
Scaling is achieved by normalizing the MACD values relative to the standard deviation and the average candle range. This makes the lines and histogram dynamically adjust to market volatility, improving their readability and utility on the price chart. The scaling formulas are:
-MACD Scaled: macdNorm * avgRangeLines * scaleFactor
-Signal Scaled: signalNorm * avgRangeLines * scaleFactor
-Histogram Scaled: histNorm * avgRangeHist * scaleFactor
Where:
-macdNorm and signalNorm are the normalized MACD and signal line values.
-avgRangeLines and avgRangeHist are the average candle ranges.
-scaleFactor is the scaling multiplier (default: 2).
The positioning of the lines and histogram is relative to the candle midpoint (candleMid = (high + low) / 2), ensuring proper display on the price chart. Divergences are calculated based on the traditional MACD histogram (before scaling), maintaining consistency with standard divergence detection methodology.
█INDICATOR FEATURES
-Dynamic MACD and Signal Lines: Scaled and overlaid on the price chart, facilitating the identification of reversal points.
-Histogram: Displays the difference between the MACD and signal lines, dynamically adjusted to market volatility.
-Divergence Detection: Ability to detect regular and hidden divergences (bullish and bearish) based on the traditional MACD histogram, with options to enable/disable their display.
-Visual Customization: Options to adjust colors, line thickness, transparency, and enable/disable elements such as the zero line, MACD line, signal line, or histogram.
-Smoothing: Smoothing length for lines (default: 1) and histogram (default: 3). Smoothing may delay crossover signals, which should be considered during analysis.
-Alerts: Alert conditions for MACD and signal line crossovers, enabling notifications for potential buy/sell signals.
█ HOW TO SET UP THE INDICATOR
-Add the "MACD Scaled Overlay" indicator to your TradingView chart.
-Configure parameters in the settings, such as EMA lengths, scaling multiplier, or smoothing periods, to match your trading style.
-Enable or disable the display of the zero line, MACD line, signal line, or histogram based on your needs.
-Adjust colors and line thickness in the "Style" section and transparency settings in the input section to optimize visualization.
█ HOW TO USE
Add the indicator to your chart, configure the parameters, and observe the interactions of the price with the MACD line, signal line, and histogram to identify potential entry and exit points. Key signals include:
-MACD and Signal Line Crossovers: A crossover of the MACD line above the signal line may indicate a buy signal (bullish cross), while a crossover below the signal line may indicate a sell signal (bearish cross).
-Crossings Through the Price Line (Zero): The MACD line or histogram crossing the price line (candle midpoint) may indicate a change in momentum. For example, the histogram moving from negative to positive values near the price line may signal increasing bullish trend strength.
-Divergences: Detection of regular and hidden divergences (bullish and bearish) based on the traditional MACD histogram can help predict trend reversals. Divergences are not standalone signals, as they are delayed by the specified pivot length (default: 3). However, they help strengthen the significance of other signals, such as crossovers or support/resistance levels.
The indicator is most effective when combined with other tools, such as Fibonacci levels, pivot points, or support/resistance lines, to confirm signals.
The "MACD Scaled Overlay" indicator is an advanced version of the classic MACD (Moving Average Convergence Divergence) oscillator that displays signals directly on the price chart. Instead of a traditional separate panel, the MACD line, signal line, and histogram are scaled and overlaid on the price chart, making it easier to identify key price levels and potential reversal points. The indicator also supports the detection of divergences (regular and hidden) and offers extensive customization options, such as adjusting colors, line thickness, and enabling/disabling visual elements.
█ CONCEPTS
The "MACD Scaled Overlay" indicator is designed to simplify trend and reversal analysis by integrating MACD signals with the price chart. The MACD Scaled Overlay is scaled relative to the average candle range, allowing the lines and histogram to dynamically adjust to market volatility. Additionally, the indicator enables the detection of divergences (bullish and bearish, both regular and hidden) based on the traditional MACD histogram (before scaling), ensuring consistency with classic divergence analysis. The indicator is most effective when combined with other technical analysis tools, such as Fibonacci levels, pivot points, or trend lines.
█ MACD Calculations and Scaling
The indicator is based on the classic MACD formula, which includes:
-MACD Line: The difference between the fast EMA (default: 12) and the slow EMA (default: 26).
-Signal Line: The EMA of the MACD line (default: 9).
-Histogram: The difference between the MACD line and the signal line.
Scaling is achieved by normalizing the MACD values relative to the standard deviation and the average candle range. This makes the lines and histogram dynamically adjust to market volatility, improving their readability and utility on the price chart. The scaling formulas are:
-MACD Scaled: macdNorm * avgRangeLines * scaleFactor
-Signal Scaled: signalNorm * avgRangeLines * scaleFactor
-Histogram Scaled: histNorm * avgRangeHist * scaleFactor
Where:
-macdNorm and signalNorm are the normalized MACD and signal line values.
-avgRangeLines and avgRangeHist are the average candle ranges.
-scaleFactor is the scaling multiplier (default: 2).
The positioning of the lines and histogram is relative to the candle midpoint (candleMid = (high + low) / 2), ensuring proper display on the price chart. Divergences are calculated based on the traditional MACD histogram (before scaling), maintaining consistency with standard divergence detection methodology.
█INDICATOR FEATURES
-Dynamic MACD and Signal Lines: Scaled and overlaid on the price chart, facilitating the identification of reversal points.
-Histogram: Displays the difference between the MACD and signal lines, dynamically adjusted to market volatility.
-Divergence Detection: Ability to detect regular and hidden divergences (bullish and bearish) based on the traditional MACD histogram, with options to enable/disable their display.
-Visual Customization: Options to adjust colors, line thickness, transparency, and enable/disable elements such as the zero line, MACD line, signal line, or histogram.
-Smoothing: Smoothing length for lines (default: 1) and histogram (default: 3). Smoothing may delay crossover signals, which should be considered during analysis.
-Alerts: Alert conditions for MACD and signal line crossovers, enabling notifications for potential buy/sell signals.
█ HOW TO SET UP THE INDICATOR
-Add the "MACD Scaled Overlay" indicator to your TradingView chart.
-Configure parameters in the settings, such as EMA lengths, scaling multiplier, or smoothing periods, to match your trading style.
-Enable or disable the display of the zero line, MACD line, signal line, or histogram based on your needs.
-Adjust colors and line thickness in the "Style" section and transparency settings in the input section to optimize visualization.
█ HOW TO USE
Add the indicator to your chart, configure the parameters, and observe the interactions of the price with the MACD line, signal line, and histogram to identify potential entry and exit points. Key signals include:
-MACD and Signal Line Crossovers: A crossover of the MACD line above the signal line may indicate a buy signal (bullish cross), while a crossover below the signal line may indicate a sell signal (bearish cross).
-Crossings Through the Price Line (Zero): The MACD line or histogram crossing the price line (candle midpoint) may indicate a change in momentum. For example, the histogram moving from negative to positive values near the price line may signal increasing bullish trend strength.
-Divergences: Detection of regular and hidden divergences (bullish and bearish) based on the traditional MACD histogram can help predict trend reversals. Divergences are not standalone signals, as they are delayed by the specified pivot length (default: 3). However, they help strengthen the significance of other signals, such as crossovers or support/resistance levels.
The indicator is most effective when combined with other tools, such as Fibonacci levels, pivot points, or support/resistance lines, to confirm signals.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.