Indicators: Adaptive_MACD

 

Adaptive_MACD:

Adaptive MACD is a dynamic momentum indicator that adjusts its smoothing based on market conditions. It calculates a Pearson correlation coefficient between price and bar index over a user-defined period, then uses the resulting R² to blend two different MACD coefficient sets. This makes the MACD line more responsive during strong trends and smoother in sideways markets. The indicator plots a color-coded histogram (strong/weak bullish/bearish) and an optional auto-contrast MACD line that adapts to the chart background. Inputs allow customization of the R² period, fast/slow lengths, signal period, and colors. Suitable for trend-following and detecting momentum shifts.

Adaptive_MACD

Author: Shi Yuan Wang