diff --git a/Indicators/MyIndicators/Authors/Ehlers/5_Ehlers_Hybrids/MACD_SuperSmoother_Pro.md b/Indicators/MyIndicators/Authors/Ehlers/5_Ehlers_Hybrids/MACD_SuperSmoother_Pro.md new file mode 100644 index 0000000..5900f06 --- /dev/null +++ b/Indicators/MyIndicators/Authors/Ehlers/5_Ehlers_Hybrids/MACD_SuperSmoother_Pro.md @@ -0,0 +1,70 @@ +# MACD SuperSmoother Professional + +## 1. Summary (Introduction) + +The `MACD_SuperSmoother_Pro` is a modern, high-performance variant of the classic MACD indicator. It replaces all three traditional Exponential Moving Averages (EMAs) with John Ehlers' highly responsive, low-lag SuperSmoother filters. + +The result is a "pure" Ehlers-based system that provides a much smoother, more cyclical, and significantly faster representation of momentum compared to its conventional counterpart. By using SuperSmoothers for the fast line, slow line, and the signal line, the indicator minimizes the cumulative lag that is a common drawback of the standard MACD. + +This indicator calculates and displays all three core components of a MACD system: + +* **MACD Line:** The difference between a fast and a slow SuperSmoother filter. +* **Signal Line:** A SuperSmoother filter applied to the MACD Line. +* **Histogram:** The difference between the MACD Line and the Signal Line. + +## 2. Mathematical Foundations and Calculation Logic + +The entire system is built using SuperSmoother filters, which are advanced two-pole Gaussian filters designed for optimal smoothing with minimal lag. + +### Required Components + +* **Fast Period (N)** and **Slow Period (M)** for the MACD Line. +* **Signal Period (S)** for the Signal Line. +* **Source Price (P)**. + +### Calculation Steps (Algorithm) + +1. **Calculate the Fast and Slow SuperSmoother Filters:** Two separate SuperSmoother filters are calculated on the source price `P`, one with a fast period and one with a slow period. + * $\text{Fast Smoother}_t = \text{SuperSmoother}(P, N)_t$ + * $\text{Slow Smoother}_t = \text{SuperSmoother}(P, M)_t$ + +2. **Calculate the MACD Line:** The MACD Line is the difference between the two filters. + * $\text{MACD Line}_t = \text{Fast Smoother}_t - \text{Slow Smoother}_t$ + +3. **Calculate the Signal Line:** A third SuperSmoother filter is applied directly to the `MACD Line` calculated in the previous step, using the signal period. + * $\text{Signal Line}_t = \text{SuperSmoother}(\text{MACD Line}, S)_t$ + +4. **Calculate the Histogram:** The final output is the difference between the MACD Line and the Signal Line. + * $\text{Histogram}_t = \text{MACD Line}_t - \text{Signal Line}_t$ + +## 3. MQL5 Implementation Details + +* **Modular and Composite Design:** The core logic is encapsulated in the `MACD_SuperSmoother_Calculator.mqh`. This calculator uses a composition-based design: + * It contains **two instances** of our robust, state-managed `Ehlers_Smoother_Calculator` to generate the base MACD line from the source price. + * For maximum stability, the **signal line's SuperSmoother filter is calculated manually** within the `Calculate` method, with its own dedicated state-management variables (`m_sig_f1`, `m_sig_f2`). + +* **Robust State Management:** All recursive calculations, both in the external `Ehlers_Smoother_Calculator` and for the internal signal line calculation, use persistent member variables to maintain their state between ticks. This is critical for the stability and accuracy of Ehlers' filters. + +* **Heikin Ashi Integration:** A "Factory Method" (`CreateSmootherInstance`) is used to instantiate the correct type of smoother (`standard` or `_HA`), allowing the Heikin Ashi logic to be cleanly integrated without duplicating the main calculation chain. + +## 4. Parameters + +* **Fast Period (`InpFastPeriod`):** The period for the fast SuperSmoother filter. Default is `12`. +* **Slow Period (`InpSlowPeriod`):** The period for the slow SuperSmoother filter. Default is `26`. +* **Signal Period (`InpSignalPeriod`):** The period for the signal line's SuperSmoother filter. Default is `9`. +* **Applied Price (`InpSourcePrice`):** The source price for the calculation (Standard or Heikin Ashi). + +## 5. Usage and Interpretation + +The MACD SuperSmoother provides the same types of signals as a traditional MACD, but often with greater clarity and less delay. + +* **Signal Line Crossover (Primary Signal):** + * **Bullish Crossover:** When the **MACD Line (blue) crosses above the Signal Line (red)**, it is a buy signal. This is confirmed when the histogram crosses above zero. + * **Bearish Crossover:** When the **MACD Line crosses below the Signal Line**, it is a sell signal. This is confirmed when the histogram crosses below zero. +* **Zero Line Crossover:** + * When the MACD Line crosses **above the zero line**, it indicates that overall momentum has shifted to bullish. + * When the MACD Line crosses **below the zero line**, it indicates that momentum has shifted to bearish. This can be used as a trend filter. +* **Histogram Dynamics:** + * **Growing Bars:** Indicate that momentum is accelerating in the current direction. + * **Shrinking Bars (towards zero):** Indicate that momentum is decelerating, providing an early warning of a potential trend change or consolidation. +* **Divergence:** As with any MACD, divergence between the histogram's peaks/troughs and price action can signal powerful reversal opportunities. Because the SuperSmoother version is smoother and more responsive, these divergences can be clearer and appear earlier than on a traditional MACD.