OPEN-SOURCE SCRIPT
Moving Average Convergence Divergence TIME

Overview
This is a customized MACD (Moving Average Convergence Divergence) indicator for TradingView, labeled "MACDH" on the chart, with a few enhancements beyond the stock MACD.
Core Components
MACD Calculation
Uses a fast moving average (default 12) and slow moving average (default 26), both configurable as EMA or SMA
MACD line = Fast MA − Slow MA
Signal line = moving average of the MACD line (default 9-period, EMA or SMA)
Histogram = MACD line − Signal line
Multi-Timeframe Support
You can calculate the MACD on a different timeframe than the chart itself (e.g., view 5-minute chart but calculate MACD on 1-hour data) via request.security
A "Wait for timeframe closes" toggle lets you choose between using the confirmed (closed) value of the higher timeframe or the live, repainting value
Color-Coded Histogram
Dark teal: histogram is positive and rising
Light teal: histogram is positive but falling
Light red: histogram is negative but rising
Dark red: histogram is negative and falling
This gives a quick visual read on momentum direction, not just above/below zero
Plots
Histogram as columns
MACD line
Signal line (orange)
Zero line for reference
Alerts
Fires when the histogram crosses from positive to negative ("rising to falling")
Fires when the histogram crosses from negative to positive ("falling to rising")
Timeframe Watermark
Displays a small label on the chart (e.g., "1H", "4H", "1D") showing which timeframe the MACD is actually being calculated on — useful since it can differ from the chart's own timeframe
Position (corner) and font size are both configurable
In short: it's a standard MACD with configurable multi-timeframe calculation, momentum-based histogram coloring, crossover alerts, and an on-chart label confirming which timeframe is driving the calculation.
This is a customized MACD (Moving Average Convergence Divergence) indicator for TradingView, labeled "MACDH" on the chart, with a few enhancements beyond the stock MACD.
Core Components
MACD Calculation
Uses a fast moving average (default 12) and slow moving average (default 26), both configurable as EMA or SMA
MACD line = Fast MA − Slow MA
Signal line = moving average of the MACD line (default 9-period, EMA or SMA)
Histogram = MACD line − Signal line
Multi-Timeframe Support
You can calculate the MACD on a different timeframe than the chart itself (e.g., view 5-minute chart but calculate MACD on 1-hour data) via request.security
A "Wait for timeframe closes" toggle lets you choose between using the confirmed (closed) value of the higher timeframe or the live, repainting value
Color-Coded Histogram
Dark teal: histogram is positive and rising
Light teal: histogram is positive but falling
Light red: histogram is negative but rising
Dark red: histogram is negative and falling
This gives a quick visual read on momentum direction, not just above/below zero
Plots
Histogram as columns
MACD line
Signal line (orange)
Zero line for reference
Alerts
Fires when the histogram crosses from positive to negative ("rising to falling")
Fires when the histogram crosses from negative to positive ("falling to rising")
Timeframe Watermark
Displays a small label on the chart (e.g., "1H", "4H", "1D") showing which timeframe the MACD is actually being calculated on — useful since it can differ from the chart's own timeframe
Position (corner) and font size are both configurable
In short: it's a standard MACD with configurable multi-timeframe calculation, momentum-based histogram coloring, crossover alerts, and an on-chart label confirming which timeframe is driving the calculation.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.