OPEN-SOURCE SCRIPT
MACD Pro

The MACD Pro is a modern take on the classic MACD, designed to give traders deeper insights into market momentum, trend conditions, and potential turning points. While it keeps the standard MACD foundation, it introduces a few enhancements to make it more adaptive and visually intuitive.
At its core, the indicator calculates the traditional MACD line, Signal line and Histogram. The histogram can be optionally displayed.
One of the things that set this version apart is the addition of the MACD Leader, an optional feature that makes the MACD more responsive to price action. By applying an adaptive smoothing factor (Leader Sensitivity), the Leader line can provide earlier momentum cues compared to the standard MACD and help anticipate shifts before they become obvious on a standard MACD indicator.
Another enhancement is the regime-based color system for the MACD line. Instead of simply coloring based on the MACD or histogram itself, this indicator identifies the overall market regime using momentum and trend strength conditions.
Bullish Regime: Momentum is positive and trend strength is above average.
Bearish Regime: Momentum is negative and trend strength is above average.
Sideways Regime: Momentum remains weak and within noise levels.
This regime detection allows the MACD line to visually adapt, giving traders an extra layer of context beyond standard MACD signals to blend momentum analysis with market conditions, helping distinguish between trending and ranging environments.
At its core, the indicator calculates the traditional MACD line, Signal line and Histogram. The histogram can be optionally displayed.
One of the things that set this version apart is the addition of the MACD Leader, an optional feature that makes the MACD more responsive to price action. By applying an adaptive smoothing factor (Leader Sensitivity), the Leader line can provide earlier momentum cues compared to the standard MACD and help anticipate shifts before they become obvious on a standard MACD indicator.
Another enhancement is the regime-based color system for the MACD line. Instead of simply coloring based on the MACD or histogram itself, this indicator identifies the overall market regime using momentum and trend strength conditions.
Bullish Regime: Momentum is positive and trend strength is above average.
Bearish Regime: Momentum is negative and trend strength is above average.
Sideways Regime: Momentum remains weak and within noise levels.
This regime detection allows the MACD line to visually adapt, giving traders an extra layer of context beyond standard MACD signals to blend momentum analysis with market conditions, helping distinguish between trending and ranging environments.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.