new files added

This commit is contained in:
Toh4iem9
2025-11-11 13:30:39 +01:00
parent 6cec5f8991
commit a88d14744b
@@ -0,0 +1,69 @@
# MACD SuperSmoother Histogram Professional
## 1. Summary (Introduction)
The `MACD_SuperSmoother_Histogram_Pro` is the dedicated histogram component for our SuperSmoother MACD system. Its sole purpose is to calculate and display the difference between the `MACD_SuperSmoother_Line_Pro` and its corresponding signal line.
This indicator visually represents the convergence and divergence of momentum. The height and depth of the histogram bars provide an immediate sense of momentum acceleration and deceleration in a low-lag environment.
It is designed as a **companion indicator** to be overlaid in the same window as the `MACD_SuperSmoother_Line_Pro`. When their parameters are synchronized, they form a complete, modern, and highly responsive MACD system. The signal line's smoothing method is user-selectable from the four standard moving average types (SMA, EMA, SMMA, LWMA).
## 2. Mathematical Foundations and Calculation Logic
To ensure perfect synchronization and accuracy without external dependencies, this indicator performs the full MACD calculation internally before outputting only the histogram.
### Required Components
* **Fast Period (N)** and **Slow Period (M)** for the MACD Line.
* **Signal Line Period (S)** and **MA Type** for the Signal Line.
* **Source Price (P)**.
### Calculation Steps (Algorithm)
1. **Calculate the MACD Line:** First, a fast and a slow SuperSmoother filter are calculated on the source price. The MACD Line is their difference.
* $\text{MACD Line}_t = \text{SuperSmoother}(P, N)_t - \text{SuperSmoother}(P, M)_t$
2. **Calculate the Signal Line:** A moving average (of the user-selected type) is applied to the MACD Line calculated in the previous step.
* $\text{Signal Line}_t = \text{MA}(\text{MACD Line}, S)_t$
3. **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
* **Self-Contained Calculation:** The indicator is fully self-contained. Its engine (`MACD_SuperSmoother_Histogram_Calculator.mqh`) internally recalculates the entire SuperSmoother MACD line using our robust `Ehlers_Smoother_Calculator`. This "shared engine" architecture avoids the instability of `iCustom` calls and ensures that the histogram is always perfectly synchronized with its corresponding line indicator, provided the inputs match.
* **Reusable Components:** The calculator efficiently reuses our modular components:
* It contains two instances of `CEhlersSmootherCalculator` to generate the base MACD line.
* It uses our universal `CalculateMA` helper function to apply the selected moving average for the signal line.
* **Object-Oriented Design (Inheritance):** The standard `_HA` derived class architecture is used to seamlessly support calculations on Heikin Ashi price data.
## 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 lookback period for the signal line's moving average. Default is `9`.
* **Signal MA Type (`InpSignalMAType`):** The type of moving average to use for the signal line (SMA, EMA, SMMA, LWMA). Default is `EMA`.
* **Applied Price (`InpSourcePrice`):** The source price for the calculation (Standard or Heikin Ashi).
## 5. Usage and Interpretation
This indicator is designed to be used in conjunction with `MACD_SuperSmoother_Line_Pro`.
**How to set up the full system:**
1. Add the `MACD_SuperSmoother_Line_Pro` indicator to a chart window.
2. Drag the `MACD_SuperSmoother_Histogram_Pro` indicator **onto the same indicator window**.
3. **Crucially, ensure that the `InpFastPeriod`, `InpSlowPeriod`, and `InpSourcePrice` parameters in both indicators are identical.**
4. You can now adjust the `Signal Period` and `Signal MA Type` in the Histogram indicator to see how different signal lines affect the momentum profile.
### Interpreting the Histogram
* **Zero Line Crossover:** This is the most direct signal.
* When the histogram crosses from **negative to positive**, it confirms that the MACD Line has crossed above its Signal Line, generating a bullish signal.
* When the histogram crosses from **positive to negative**, it confirms a bearish crossover.
* **Momentum Acceleration/Deceleration:**
* **Growing Bars:** If the histogram bars are getting larger (further from zero), it means the distance between the MACD Line and Signal Line is increasing, and momentum is accelerating.
* **Shrinking Bars (towards zero):** If the histogram bars are getting smaller, it signals that momentum is decelerating, which can be an early warning of a potential trend change or consolidation.
* **Divergence:** Divergence between the histogram's peaks/troughs and price action can signal powerful reversal opportunities.