The MACD Pro is an enhanced version of the classic Moving Average Convergence/Divergence indicator. While the standard MACD uses Exponential Moving Averages (EMAs), this "Pro" version offers traders the flexibility to choose from **seven** different moving average types for its calculation.
This customization allows traders to fine-tune the indicator's responsiveness and smoothness. Our `MACD_Pro` implementation is a unified, professional version that allows the calculation to be based on either **standard** or **Heikin Ashi** price data, selectable from a single input parameter.
3.**Signal Engine:** Calculates the Signal Line smoothing.
This ensures that the core MA logic is consistent across the entire indicator and allows for advanced combinations (e.g., DEMA-based MACD with TEMA Signal).
* **State Tracking:** It utilizes `prev_calculated` to process only new bars.
* **Persistent Buffers:** Internal buffers persist their state between ticks.
* **Robust Offset Handling:** The engine correctly handles the initialization periods of the chained calculations (Fast/Slow MA -> MACD Line -> Signal Line), ensuring that each step starts only when valid data is available. This prevents artifacts and "INF" errors at the beginning of the chart.
* **Heikin Ashi Integration:** An inherited `_HA` class allows the calculation to be performed seamlessly on smoothed Heikin Ashi data, leveraging the same optimized engine.
* **Fast Period (`InpFastPeriod`):** The period for the shorter-term MA. (Default: `12`).
* **Slow Period (`InpSlowPeriod`):** The period for the longer-term MA. (Default: `26`).
* **Signal Period (`InpSignalPeriod`):** The period for the signal line's MA. (Default: `9`).
* **Applied Price (`InpSourcePrice`):** The source price for the calculation. (Standard or Heikin Ashi).
* **Source MA Type (`InpSourceMAType`):** The MA type for the Fast and Slow lines. Supports: **SMA, EMA, SMMA, LWMA, TMA, DEMA, TEMA**. (Default: `EMA`).
* **Signal MA Type (`InpSignalMAType`):** The MA type for the Signal line. Supports: **SMA, EMA, SMMA, LWMA, TMA, DEMA, TEMA**. (Default: `EMA`).