AdaptiveMACD
- インディケータ
- バージョン: 1.0
Adaptive MACD - R² Based Adaptive MACD Indicator
Overview
Adaptive MACD is an innovative MetaTrader 5 indicator that improves upon the traditional MACD. By introducing the Pearson correlation coefficient to calculate the R² value of price trends, this indicator can adapt to market conditions and dynamically adjust its sensitivity. It helps traders capture trends more effectively while filtering out market noise.
How It Works
Traditional MACD uses a fixed difference between fast and slow EMAs. Adaptive MACD calculates the correlation coefficient between the closing price and the time series to obtain the R² value. This R² value is mapped to the range [0.5, 1] and used to calculate the adaptive coefficient K.
- In strong trends, the indicator reacts quickly and captures momentum.
- In ranging/weak trend markets, it smooths out noise and avoids false signals.
Visual Features
- Color Histogram: Uses four colors (strong bull, weak bull, strong bear, weak bear) to intuitively display the current momentum strength. Opaque colors indicate strengthening momentum, while semi-transparent colors indicate weakening momentum.
- Auto Foreground Color: The MACD line color can automatically adjust to black or white based on the chart background brightness to ensure visibility.
- Separate Window: Displayed in a sub-window to avoid interfering with main chart analysis.
Input Parameters
- R2Length: R2 period (correlation coefficient window), default 20.
- Fast / Slow: Fast/Slow line length (EMA smoothing factor), default 10/20.
- Signal: Signal line length, default 9.
- Style: Customizable colors for bull, bear, MACD line, and signal line. You can also enable/disable auto MACD line coloring.
Installation
- Place the file in the MQL5/Indicators/ directory of your MetaTrader 5 terminal.
Disclaimer
This indicator is for technical analysis reference only and does not constitute investment advice.
