diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Histogram_Pro.md b/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Histogram_Pro.md deleted file mode 100644 index e7753dd..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Histogram_Pro.md +++ /dev/null @@ -1,69 +0,0 @@ -# MACD Laguerre Histogram Professional - -## 1. Summary (Introduction) - -The `MACD_Laguerre_Histogram_Pro` is the dedicated histogram component for our Laguerre MACD system. Its sole purpose is to calculate and display the difference between the `MACD_Laguerre_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. - -It is designed as a **companion indicator** to be overlaid in the same window as the `MACD_Laguerre_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 Gamma ($\gamma_{fast}$)** and **Slow Gamma ($\gamma_{slow}$)** 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 Laguerre filter are calculated on the source price. The MACD Line is their difference. - * $\text{MACD Line}_t = \text{LaguerreFilter}(P, \gamma_{fast})_t - \text{LaguerreFilter}(P, \gamma_{slow})_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. To guarantee accuracy, its engine (`MACD_Laguerre_Histogram_Calculator.mqh`) internally recalculates the entire Laguerre MACD line using the `Laguerre_Engine`. 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 `CLaguerreEngine` 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 - -* **Gamma 1 (`InpGamma1`):** The gamma coefficient for one of the base Laguerre filters (e.g., `0.2` for fast). -* **Gamma 2 (`InpGamma2`):** The gamma coefficient for the other base Laguerre filter (e.g., `0.8` for slow). -* **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_Laguerre_Line_Pro`. - -**How to set up the full system:** - -1. Add the `MACD_Laguerre_Line_Pro` indicator to a chart window. -2. Drag the `MACD_Laguerre_Histogram_Pro` indicator **onto the same indicator window**. -3. **Crucially, ensure that the `InpGamma1`, `InpGamma2`, 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:** If the histogram bars are getting smaller (closer to zero), 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. diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Histogram_Pro.mq5 b/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Histogram_Pro.mq5 deleted file mode 100644 index 3839621..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Histogram_Pro.mq5 +++ /dev/null @@ -1,82 +0,0 @@ -//+------------------------------------------------------------------+ -//| MACD_Laguerre_Histogram_Pro.mq5 | -//| Copyright 2025, xxxxxxxx| -//| | -//+------------------------------------------------------------------+ -#property copyright "Copyright 2025, xxxxxxxx" -#property link "" -#property version "1.00" -#property description "Histogram for the Laguerre MACD. To be used with MACD_Laguerre_Line_Pro." - -#property indicator_separate_window -#property indicator_buffers 1 -#property indicator_plots 1 - -#property indicator_label1 "Histogram" -#property indicator_type1 DRAW_HISTOGRAM -#property indicator_color1 clrSilver -#property indicator_width1 1 -#property indicator_level1 0.0 -#property indicator_levelstyle STYLE_DOT - -#include - -//--- Input Parameters --- -input group "Laguerre MACD Settings" -input double InpGamma1 = 0.2; // Fast Laguerre Gamma (smaller value) -input double InpGamma2 = 0.8; // Slow Laguerre Gamma (larger value) - -input group "Signal Line Settings" -input int InpSignalPeriod = 9; -input ENUM_MA_TYPE InpSignalMAType = EMA; - -input group "Price Source" -input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD; - -//--- Indicator Buffers --- -double BufferHistogram[]; - -//--- Global calculator object --- -CMACDLaguerreHistogramCalculator *g_calculator; - -//+------------------------------------------------------------------+ -int OnInit() - { - SetIndexBuffer(0, BufferHistogram, INDICATOR_DATA); - ArraySetAsSeries(BufferHistogram, false); - - if(InpSourcePrice <= PRICE_HA_CLOSE) - g_calculator = new CMACDLaguerreHistogramCalculator_HA(); - else - g_calculator = new CMACDLaguerreHistogramCalculator(); - - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpGamma1, InpGamma2, InpSignalPeriod, InpSignalMAType)) - { - Print("Failed to create or initialize MACD Laguerre Histogram Calculator."); - return(INIT_FAILED); - } - - string ma_name = EnumToString(InpSignalMAType); - StringToUpper(ma_name); - IndicatorSetString(INDICATOR_SHORTNAME, StringFormat("Laguerre Histo(%s,%d)", ma_name, InpSignalPeriod)); - - PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, 2 + InpSignalPeriod); - IndicatorSetInteger(INDICATOR_DIGITS, _Digits); - - return(INIT_SUCCEEDED); - } - -//+------------------------------------------------------------------+ -void OnDeinit(const int reason) { if(CheckPointer(g_calculator) != POINTER_INVALID) delete g_calculator; } - -//+------------------------------------------------------------------+ -int OnCalculate(const int rates_total, const int, const datetime&[], const double &open[], const double &high[], const double &low[], const double &close[], const long&[], const long&[], const int&[]) - { - if(CheckPointer(g_calculator) == POINTER_INVALID) - return 0; - ENUM_APPLIED_PRICE price_type = (InpSourcePrice <= PRICE_HA_CLOSE) ? (ENUM_APPLIED_PRICE)(-(int)InpSourcePrice) : (ENUM_APPLIED_PRICE)InpSourcePrice; - g_calculator.Calculate(rates_total, open, high, low, close, price_type, BufferHistogram); - return(rates_total); - } -//+------------------------------------------------------------------+ -//+------------------------------------------------------------------+ diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Line_Pro.md b/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Line_Pro.md deleted file mode 100644 index 0b3b746..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Line_Pro.md +++ /dev/null @@ -1,71 +0,0 @@ -# MACD Laguerre Line Professional - -## 1. Summary (Introduction) - -The `MACD_Laguerre_Line_Pro` is a modern variant of the classic MACD that replaces traditional Exponential Moving Averages (EMAs) with John Ehlers' extremely responsive, low-lag Laguerre filters. The result is an oscillator that tracks momentum changes with significantly less delay than its conventional counterpart, producing a much smoother, more cyclical output. - -This specific indicator is a **"Line Only"** version, designed as a foundational component. It calculates and displays only the core MACD Line (the difference between the fast and slow Laguerre filters). - -Its primary purpose is to serve as a clean base for building a complete, customized MACD system visually. It is intended to be used in conjunction with our modular helper indicators, such as `Signal_Line_Pro` or `MACD_Laguerre_Histogram_Pro`, allowing for flexible experimentation with different types of signal lines. - -## 2. Mathematical Foundations and Calculation Logic - -The concept is to create a momentum oscillator from the difference between a fast-reacting and a slow-reacting Laguerre filter. - -### Required Components - -* **Fast Gamma ($\gamma_{fast}$):** The coefficient for the fast Laguerre filter. A **smaller** gamma value (closer to 0) results in a faster, more responsive filter. -* **Slow Gamma ($\gamma_{slow}$):** The coefficient for the slow Laguerre filter. A **larger** gamma value (closer to 1) results in a slower, smoother filter. -* **Source Price (P):** The price series for the calculation. - -### Calculation Steps (Algorithm) - -1. **Calculate the Fast Laguerre Filter:** A Laguerre filter is calculated on the source price `P` using the fast gamma, $\gamma_{fast}$. - * $\text{Fast Filter}_t = \text{LaguerreFilter}(P, \gamma_{fast})_t$ - -2. **Calculate the Slow Laguerre Filter:** A second Laguerre filter is calculated on the same source price `P` using the slow gamma, $\gamma_{slow}$. - * $\text{Slow Filter}_t = \text{LaguerreFilter}(P, \gamma_{slow})_t$ - -3. **Calculate the MACD Line:** The final MACD Line is the difference between the two filters. - * $\text{MACD Line}_t = \text{Fast Filter}_t - \text{Slow Filter}_t$ - -## 3. MQL5 Implementation Details - -* **Modular Engine (`Laguerre_Engine.mqh`):** The indicator leverages our existing, robust `Laguerre_Engine.mqh` for all core filter calculations. - -* **Object-Oriented Design (Composition):** The `CMACDLaguerreLineCalculator` class does not re-implement the filter logic. Instead, it **contains two instances** of the `CLaguerreEngine` class—one for the fast filter and one for the slow one. This is a clean and highly reusable application of the composition design pattern. - -* **Robust Initialization:** The `Init` method is "foolproof." It automatically identifies which of the two user-provided gamma values is smaller (fast) and which is larger (slow) using `MathMin` and `MathMax`, ensuring the indicator always works correctly regardless of the input order. - -* **Heikin Ashi Integration:** The standard `_HA` derived class architecture is used to seamlessly support calculations on Heikin Ashi price data. - -## 4. Parameters - -* **Gamma 1 (`InpGamma1`):** The gamma coefficient for one of the Laguerre filters. A good starting value for the fast filter is `0.2`. -* **Gamma 2 (`InpGamma2`):** The gamma coefficient for the other Laguerre filter. A good starting value for the slow filter is `0.8`. -* **Applied Price (`InpSourcePrice`):** The source price for the calculation (Standard or Heikin Ashi). - -## 5. Usage and Interpretation - -This indicator can be used both as a standalone momentum line and as the base for a full MACD system. - -### As a Standalone Oscillator - -* **Zero Line Crossover:** When the MACD Line crosses above the zero line, it indicates that the fast filter is now above the slow filter, signaling a shift to bullish momentum. A cross below zero signals a shift to bearish momentum. -* **Slope and Peaks/Troughs:** The steepness of the line indicates the strength of the momentum. Extreme peaks and troughs can signal potential momentum exhaustion. - -### Building a Full MACD System for Testing (Recommended Use) - -The primary purpose of this indicator is to serve as a clean base for visually testing different types of signal lines. The MetaTrader 5 platform's built-in "Moving Average" indicator is the perfect tool for this. - -**How to add a Signal Line for experimentation:** - -1. Add the `MACD_Laguerre_Line_Pro` indicator to a chart window. -2. Open the "Navigator" window (Ctrl+N). -3. Find the built-in "Moving Average" indicator under the "Indicators" -> "Trend" section. -4. **Drag and drop** the "Moving Average" indicator directly **onto the `MACD_Laguerre_Line_Pro` indicator's window**. -5. The Moving Average properties window will appear. Go to the "Parameters" tab. -6. In the **"Apply to:"** dropdown menu, select **"Previous Indicator's Data"**. -7. Now, you can freely experiment with the `Period`, `MA method` (SMA, EMA, etc.), and `Shift` settings to find the best-fitting signal line for your strategy. The moving average will be calculated on the MACD Line and displayed in the same window. - -By combining these two indicators, you can visually test and create a fully customized Laguerre MACD system before committing to a final implementation. diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Line_Pro.mq5 b/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Line_Pro.mq5 deleted file mode 100644 index 0ed4ae0..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Line_Pro.mq5 +++ /dev/null @@ -1,77 +0,0 @@ -//+------------------------------------------------------------------+ -//| MACD_Laguerre_Line_Pro.mq5 | -//| Copyright 2025, xxxxxxxx| -//| | -//+------------------------------------------------------------------+ -#property copyright "Copyright 2025, xxxxxxxx" -#property link "" -#property version "1.10" // Corrected Gamma logic (smaller = faster) -#property description "MACD Line calculated from two Laguerre filters." -#property description "Designed for applying external moving averages for testing." - -#property indicator_separate_window -#property indicator_buffers 1 -#property indicator_plots 1 - -#property indicator_label1 "MACD Line" -#property indicator_type1 DRAW_LINE -#property indicator_color1 clrDodgerBlue -#property indicator_style1 STYLE_SOLID -#property indicator_width1 1 -#property indicator_level1 0.0 -#property indicator_levelstyle STYLE_DOT - -#include - -//--- Input Parameters (Renamed for clarity) --- -input double InpGamma1 = 0.2; // Fast Laguerre Gamma (smaller value) -input double InpGamma2 = 0.8; // Slow Laguerre Gamma (larger value) -input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD; - -//--- Indicator Buffers --- -double BufferMACDLine[]; - -//--- Global calculator object --- -CMACDLaguerreLineCalculator *g_calculator; - -//+------------------------------------------------------------------+ -int OnInit() - { - SetIndexBuffer(0, BufferMACDLine, INDICATOR_DATA); - ArraySetAsSeries(BufferMACDLine, false); - - if(InpSourcePrice <= PRICE_HA_CLOSE) - g_calculator = new CMACDLaguerreLineCalculator_HA(); - else - g_calculator = new CMACDLaguerreLineCalculator(); - -//--- Pass the two gamma values directly --- - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpGamma1, InpGamma2)) - { - Print("Failed to create or initialize MACD Laguerre Line Calculator."); - return(INIT_FAILED); - } - - string short_name = StringFormat("MACD Laguerre Line%s(%.2f,%.2f)", (InpSourcePrice <= PRICE_HA_CLOSE ? " HA" : ""), InpGamma1, InpGamma2); - IndicatorSetString(INDICATOR_SHORTNAME, short_name); - - PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, 2); - IndicatorSetInteger(INDICATOR_DIGITS, _Digits); - - return(INIT_SUCCEEDED); - } - -//+------------------------------------------------------------------+ -void OnDeinit(const int reason) { if(CheckPointer(g_calculator) != POINTER_INVALID) delete g_calculator; } - -//+------------------------------------------------------------------+ -int OnCalculate(const int rates_total, const int, const datetime&[], const double &open[], const double &high[], const double &low[], const double &close[], const long&[], const long&[], const int&[]) - { - if(CheckPointer(g_calculator) == POINTER_INVALID) - return 0; - ENUM_APPLIED_PRICE price_type = (InpSourcePrice <= PRICE_HA_CLOSE) ? (ENUM_APPLIED_PRICE)(-(int)InpSourcePrice) : (ENUM_APPLIED_PRICE)InpSourcePrice; - g_calculator.Calculate(rates_total, open, high, low, close, price_type, BufferMACDLine); - return(rates_total); - } -//+------------------------------------------------------------------+ -//+------------------------------------------------------------------+ diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Pro.md b/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Pro.md deleted file mode 100644 index f82677a..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Pro.md +++ /dev/null @@ -1,70 +0,0 @@ -# MACD Laguerre Professional - -## 1. Summary (Introduction) - -The `MACD_Laguerre_Pro` is a modern, high-performance variant of the classic MACD indicator. It replaces all three traditional Exponential Moving Averages (EMAs) with John Ehlers' extremely responsive, low-lag Laguerre filters. - -The result is a "pure" Laguerre-based system that provides a much smoother, more cyclical, and significantly faster representation of momentum compared to its conventional counterpart. By using Laguerre filters 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 Laguerre filter. -* **Signal Line:** A Laguerre 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 Laguerre filters, with their speed controlled by the `gamma` ($\gamma$) coefficient. A smaller gamma results in a faster, more responsive filter. - -### Required Components - -* **Fast Gamma ($\gamma_{fast}$)** and **Slow Gamma ($\gamma_{slow}$)** for the MACD Line. -* **Signal Gamma ($\gamma_{signal}$)** for the Signal Line. -* **Source Price (P)**. - -### Calculation Steps (Algorithm) - -1. **Calculate the Fast and Slow Laguerre Filters:** Two separate Laguerre filters are calculated on the source price `P`, one with a fast gamma and one with a slow gamma. - * $\text{Fast Filter}_t = \text{LaguerreFilter}(P, \gamma_{fast})_t$ - * $\text{Slow Filter}_t = \text{LaguerreFilter}(P, \gamma_{slow})_t$ - -2. **Calculate the MACD Line:** The MACD Line is the difference between the two filters. - * $\text{MACD Line}_t = \text{Fast Filter}_t - \text{Slow Filter}_t$ - -3. **Calculate the Signal Line:** A third Laguerre filter is applied directly to the `MACD Line` calculated in the previous step, using the signal gamma. - * $\text{Signal Line}_t = \text{LaguerreFilter}(\text{MACD Line}, \gamma_{signal})_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_Laguerre_Calculator.mqh`. This calculator uses a composition-based design: - * It contains **two instances** of our robust `Laguerre_Engine` to generate the base MACD line from the source price. - * For maximum stability and to avoid complexities with applying an engine to an already calculated array, the **signal line's Laguerre filter is calculated manually** within the `Calculate` method, with its own dedicated state-management variables. - -* **Robust Initialization:** The `Init` method is "foolproof." It automatically identifies which of the two user-provided gamma values for the MACD line is smaller (fast) and which is larger (slow), ensuring the indicator always works correctly regardless of input order. - -* **Heikin Ashi Integration:** The standard `_HA` derived class architecture is used to seamlessly support calculations on Heikin Ashi price data. - -## 4. Parameters - -* **Gamma 1 (`InpGamma1`):** The gamma coefficient for one of the base Laguerre filters (e.g., `0.2` for fast). -* **Gamma 2 (`InpGamma2`):** The gamma coefficient for the other base Laguerre filter (e.g., `0.8` for slow). -* **Signal Gamma (`InpSignalGamma`):** The gamma coefficient for the signal line's Laguerre filter. A mid-range value like `0.5` is a good starting point. -* **Applied Price (`InpSourcePrice`):** The source price for the calculation (Standard or Heikin Ashi). - -## 5. Usage and Interpretation - -The MACD Laguerre 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, high-probability reversal opportunities. Because the Laguerre MACD is smoother, these divergences are often clearer and easier to spot than on a traditional MACD. diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Pro.mq5 b/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Pro.mq5 deleted file mode 100644 index d644b8d..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_Laguerre_Pro.mq5 +++ /dev/null @@ -1,91 +0,0 @@ -//+------------------------------------------------------------------+ -//| MACD_Laguerre_Pro.mq5 | -//| Copyright 2025, xxxxxxxx| -//| | -//+------------------------------------------------------------------+ -#property copyright "Copyright 2025, xxxxxxxx" -#property link "" -#property version "1.00" -#property description "Full MACD implementation using John Ehlers' Laguerre filters." - -#property indicator_separate_window -#property indicator_buffers 3 -#property indicator_plots 3 - -#property indicator_label1 "Histogram" -#property indicator_type1 DRAW_HISTOGRAM -#property indicator_color1 clrSilver -#property indicator_width1 1 -#property indicator_label2 "MACD" -#property indicator_type2 DRAW_LINE -#property indicator_color2 clrDodgerBlue -#property indicator_style2 STYLE_SOLID -#property indicator_width2 1 -#property indicator_label3 "Signal" -#property indicator_type3 DRAW_LINE -#property indicator_color3 clrOrangeRed -#property indicator_style3 STYLE_SOLID -#property indicator_width3 1 -#property indicator_level1 0.0 -#property indicator_levelstyle STYLE_DOT - -#include - -//--- Input Parameters --- -input double InpGamma1 = 0.2; // Fast Laguerre Gamma (smaller value) -input double InpGamma2 = 0.8; // Slow Laguerre Gamma (larger value) -input double InpSignalGamma = 0.5; // Signal Line Laguerre Gamma -input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD; - -//--- Indicator Buffers --- -double BufferHistogram[], BufferMACDLine[], BufferSignalLine[]; - -//--- Global calculator object --- -CMACDLaguerreCalculator *g_calculator; - -//+------------------------------------------------------------------+ -int OnInit() - { - SetIndexBuffer(0, BufferHistogram, INDICATOR_DATA); - SetIndexBuffer(1, BufferMACDLine, INDICATOR_DATA); - SetIndexBuffer(2, BufferSignalLine, INDICATOR_DATA); - ArraySetAsSeries(BufferHistogram, false); - ArraySetAsSeries(BufferMACDLine, false); - ArraySetAsSeries(BufferSignalLine, false); - - if(InpSourcePrice <= PRICE_HA_CLOSE) - g_calculator = new CMACDLaguerreCalculator_HA(); - else - g_calculator = new CMACDLaguerreCalculator(); - - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpGamma1, InpGamma2, InpSignalGamma)) - { - Print("Failed to create or initialize MACD Laguerre Calculator."); - return(INIT_FAILED); - } - - string short_name = StringFormat("MACD Laguerre%s(%.2f,%.2f,%.2f)", (InpSourcePrice <= PRICE_HA_CLOSE ? " HA" : ""), InpGamma1, InpGamma2, InpSignalGamma); - IndicatorSetString(INDICATOR_SHORTNAME, short_name); - - PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, 2); - PlotIndexSetInteger(1, PLOT_DRAW_BEGIN, 2); - PlotIndexSetInteger(2, PLOT_DRAW_BEGIN, 2); - IndicatorSetInteger(INDICATOR_DIGITS, _Digits); - - return(INIT_SUCCEEDED); - } - -//+------------------------------------------------------------------+ -void OnDeinit(const int reason) { if(CheckPointer(g_calculator) != POINTER_INVALID) delete g_calculator; } - -//+------------------------------------------------------------------+ -int OnCalculate(const int rates_total, const int, const datetime&[], const double &open[], const double &high[], const double &low[], const double &close[], const long&[], const long&[], const int&[]) - { - if(CheckPointer(g_calculator) == POINTER_INVALID) - return 0; - ENUM_APPLIED_PRICE price_type = (InpSourcePrice <= PRICE_HA_CLOSE) ? (ENUM_APPLIED_PRICE)(-(int)InpSourcePrice) : (ENUM_APPLIED_PRICE)InpSourcePrice; - g_calculator.Calculate(rates_total, open, high, low, close, price_type, BufferMACDLine, BufferSignalLine, BufferHistogram); - return(rates_total); - } -//+------------------------------------------------------------------+ -//+------------------------------------------------------------------+ diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Histogram_Pro.md b/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Histogram_Pro.md deleted file mode 100644 index 3d9c456..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Histogram_Pro.md +++ /dev/null @@ -1,69 +0,0 @@ -# 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. diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Histogram_Pro.mq5 b/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Histogram_Pro.mq5 deleted file mode 100644 index 8bc627e..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Histogram_Pro.mq5 +++ /dev/null @@ -1,82 +0,0 @@ -//+------------------------------------------------------------------+ -//| MACD_SuperSmoother_Histogram_Pro.mq5 | -//| Copyright 2025, xxxxxxxx| -//| | -//+------------------------------------------------------------------+ -#property copyright "Copyright 2025, xxxxxxxx" -#property link "" -#property version "1.00" -#property description "Histogram for the SuperSmoother MACD. To be used with MACD_SuperSmoother_Line_Pro." - -#property indicator_separate_window -#property indicator_buffers 1 -#property indicator_plots 1 - -#property indicator_label1 "Histogram" -#property indicator_type1 DRAW_HISTOGRAM -#property indicator_color1 clrSilver -#property indicator_width1 1 -#property indicator_level1 0.0 -#property indicator_levelstyle STYLE_DOT - -#include - -//--- Input Parameters --- -input group "SuperSmoother MACD Settings" -input int InpFastPeriod = 12; -input int InpSlowPeriod = 26; - -input group "Signal Line Settings" -input int InpSignalPeriod = 9; -input ENUM_MA_TYPE InpSignalMAType = EMA; - -input group "Price Source" -input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD; - -//--- Indicator Buffers --- -double BufferHistogram[]; - -//--- Global calculator object --- -CMACDSuperSmootherHistogramCalculator *g_calculator; - -//+------------------------------------------------------------------+ -int OnInit() - { - SetIndexBuffer(0, BufferHistogram, INDICATOR_DATA); - ArraySetAsSeries(BufferHistogram, false); - - if(InpSourcePrice <= PRICE_HA_CLOSE) - g_calculator = new CMACDSuperSmootherHistogramCalculator_HA(); - else - g_calculator = new CMACDSuperSmootherHistogramCalculator(); - - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpFastPeriod, InpSlowPeriod, InpSignalPeriod, InpSignalMAType)) - { - Print("Failed to create or initialize MACD SuperSmoother Histogram Calculator."); - return(INIT_FAILED); - } - - string ma_name = EnumToString(InpSignalMAType); - StringToUpper(ma_name); - IndicatorSetString(INDICATOR_SHORTNAME, StringFormat("SS Histo(%s,%d)", ma_name, InpSignalPeriod)); - - PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, InpSlowPeriod + InpSignalPeriod); - IndicatorSetInteger(INDICATOR_DIGITS, _Digits); - - return(INIT_SUCCEEDED); - } - -//+------------------------------------------------------------------+ -void OnDeinit(const int reason) { if(CheckPointer(g_calculator) != POINTER_INVALID) delete g_calculator; } - -//+------------------------------------------------------------------+ -int OnCalculate(const int rates_total, const int, const datetime&[], const double &open[], const double &high[], const double &low[], const double &close[], const long&[], const long&[], const int&[]) - { - if(CheckPointer(g_calculator) == POINTER_INVALID) - return 0; - ENUM_APPLIED_PRICE price_type = (InpSourcePrice <= PRICE_HA_CLOSE) ? (ENUM_APPLIED_PRICE)(-(int)InpSourcePrice) : (ENUM_APPLIED_PRICE)InpSourcePrice; - g_calculator.Calculate(rates_total, open, high, low, close, price_type, BufferHistogram); - return(rates_total); - } -//+------------------------------------------------------------------+ -//+------------------------------------------------------------------+ diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Line_Pro.md b/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Line_Pro.md deleted file mode 100644 index 44bdba8..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Line_Pro.md +++ /dev/null @@ -1,69 +0,0 @@ -# MACD SuperSmoother Line Professional - -## 1. Summary (Introduction) - -The `MACD_SuperSmoother_Line_Pro` is a modern variant of the classic MACD that replaces traditional Exponential Moving Averages (EMAs) with John Ehlers' highly responsive, low-lag SuperSmoother filters. The result is an oscillator that tracks momentum changes with significantly less delay than its conventional counterpart. - -This specific indicator is a **"Line Only"** version, designed as a foundational component for analysis and experimentation. It calculates and displays only the core MACD Line (the difference between the fast and slow SuperSmoother filters). - -Its primary purpose is to serve as a clean base for visually testing different types of signal lines. It is intended to be used in conjunction with the platform's built-in "Moving Average" indicator, allowing for flexible experimentation. - -## 2. Mathematical Foundations and Calculation Logic - -The concept is to create a momentum oscillator from the difference between a fast-reacting and a slow-reacting SuperSmoother filter. - -### Required Components - -* **Fast Period (N):** The period for the fast SuperSmoother filter. -* **Slow Period (M):** The period for the slow SuperSmoother filter. -* **Source Price (P):** The price series for the calculation. - -### Calculation Steps (Algorithm) - -1. **Calculate the Fast SuperSmoother Filter:** A SuperSmoother filter is calculated on the source price `P` using the fast period `N`. - * $\text{Fast Smoother}_t = \text{SuperSmoother}(P, N)_t$ - -2. **Calculate the Slow SuperSmoother Filter:** A second SuperSmoother filter is calculated on the same source price `P` using the slow period `M`. - * $\text{Slow Smoother}_t = \text{SuperSmoother}(P, M)_t$ - -3. **Calculate the MACD Line:** The final MACD Line is the difference between the two filters. - * $\text{MACD Line}_t = \text{Fast Smoother}_t - \text{Slow Smoother}_t$ - -## 3. MQL5 Implementation Details - -* **Modular Engine (`Ehlers_Smoother_Calculator.mqh`):** The indicator leverages our existing, robust, and state-managed `Ehlers_Smoother_Calculator.mqh` for all core filter calculations. - -* **Object-Oriented Design (Composition):** The `CMACDSuperSmootherLineCalculator` class does not re-implement the filter logic. Instead, it **contains two instances** of the `CEhlersSmootherCalculator` class—one for the fast filter and one for the slow one. This is a clean and highly reusable application of the composition design pattern. - -* **Factory Method for HA:** A `CreateSmootherInstance` virtual method 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. - -* **Stability:** The underlying `Ehlers_Smoother_Calculator` uses proper state management for its internal recursive variables, ensuring a stable and accurate output. - -## 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`. -* **Applied Price (`InpSourcePrice`):** The source price for the calculation (Standard or Heikin Ashi). - -## 5. Usage and Interpretation - -This indicator can be used both as a standalone momentum line and as the base for building a full MACD system for testing. - -### As a Standalone Oscillator - -* **Zero Line Crossover:** When the MACD Line crosses above the zero line, it indicates that the fast smoother is now above the slow smoother, signaling a shift to bullish momentum. A cross below zero signals a shift to bearish momentum. -* **Slope and Peaks/Troughs:** The steepness of the line indicates the strength of the momentum. - -### Building a Full MACD System for Testing (Recommended Use) - -The primary purpose of this indicator is to serve as a clean base for visually testing different types of signal lines using the platform's built-in tools. - -**How to add a Signal Line for experimentation:** - -1. Add the `MACD_SuperSmoother_Line_Pro` indicator to a chart window. -2. Open the "Navigator" window (Ctrl+N). -3. Find the built-in "Moving Average" indicator under the "Indicators" -> "Trend" section. -4. **Drag and drop** the "Moving Average" indicator directly **onto the `MACD_SuperSmoother_Line_Pro` indicator's window**. -5. The Moving Average properties window will appear. Go to the "Parameters" tab. -6. In the **"Apply to:"** dropdown menu, select **"Previous Indicator's Data"**. -7. Now, you can freely experiment with the `Period`, `MA method` (SMA, EMA, etc.), and `Shift` settings to find the best-fitting signal line for your strategy. The moving average will be calculated on the MACD Line and displayed in the same window. diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Line_Pro.mq5 b/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Line_Pro.mq5 deleted file mode 100644 index d0245a6..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Line_Pro.mq5 +++ /dev/null @@ -1,77 +0,0 @@ -//+------------------------------------------------------------------+ -//| MACD_SuperSmoother_Line_Pro.mq5 | -//| Copyright 2025, xxxxxxxx| -//| | -//+------------------------------------------------------------------+ -#property copyright "Copyright 2025, xxxxxxxx" -#property link "" -#property version "1.00" -#property description "Plots only the MACD Line from the SuperSmoother MACD." -#property description "Designed for applying external moving averages for testing." - -#property indicator_separate_window -#property indicator_buffers 1 -#property indicator_plots 1 - -//--- Plot 1: MACD Line -#property indicator_label1 "MACD Line" -#property indicator_type1 DRAW_LINE -#property indicator_color1 clrDodgerBlue -#property indicator_style1 STYLE_SOLID -#property indicator_width1 1 -#property indicator_level1 0.0 -#property indicator_levelstyle STYLE_DOT - -#include - -//--- Input Parameters --- -input int InpFastPeriod = 12; -input int InpSlowPeriod = 26; -input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD; - -//--- Indicator Buffers --- -double BufferMACDLine[]; - -//--- Global calculator object --- -CMACDSuperSmootherLineCalculator *g_calculator; - -//+------------------------------------------------------------------+ -int OnInit() - { - SetIndexBuffer(0, BufferMACDLine, INDICATOR_DATA); - ArraySetAsSeries(BufferMACDLine, false); - - if(InpSourcePrice <= PRICE_HA_CLOSE) - g_calculator = new CMACDSuperSmootherLineCalculator_HA(); - else - g_calculator = new CMACDSuperSmootherLineCalculator(); - - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpFastPeriod, InpSlowPeriod)) - { - Print("Failed to create or initialize MACD SuperSmoother Line Calculator."); - return(INIT_FAILED); - } - - string short_name = StringFormat("MACD SS Line%s(%d,%d)", (InpSourcePrice <= PRICE_HA_CLOSE ? " HA" : ""), InpFastPeriod, InpSlowPeriod); - IndicatorSetString(INDICATOR_SHORTNAME, short_name); - - PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, InpSlowPeriod); - IndicatorSetInteger(INDICATOR_DIGITS, _Digits); - - return(INIT_SUCCEEDED); - } - -//+------------------------------------------------------------------+ -void OnDeinit(const int reason) { if(CheckPointer(g_calculator) != POINTER_INVALID) delete g_calculator; } - -//+------------------------------------------------------------------+ -int OnCalculate(const int rates_total, const int, const datetime&[], const double &open[], const double &high[], const double &low[], const double &close[], const long&[], const long&[], const int&[]) - { - if(CheckPointer(g_calculator) == POINTER_INVALID) - return 0; - ENUM_APPLIED_PRICE price_type = (InpSourcePrice <= PRICE_HA_CLOSE) ? (ENUM_APPLIED_PRICE)(-(int)InpSourcePrice) : (ENUM_APPLIED_PRICE)InpSourcePrice; - g_calculator.Calculate(rates_total, open, high, low, close, price_type, BufferMACDLine); - return(rates_total); - } -//+------------------------------------------------------------------+ -//+------------------------------------------------------------------+ diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Pro.md b/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Pro.md deleted file mode 100644 index 5900f06..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Pro.md +++ /dev/null @@ -1,70 +0,0 @@ -# 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. diff --git a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Pro.mq5 b/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Pro.mq5 deleted file mode 100644 index 5d74fb2..0000000 --- a/Indicators/MyIndicators/Authors/Ehlers/MACD_SuperSmoother_Pro.mq5 +++ /dev/null @@ -1,91 +0,0 @@ -//+------------------------------------------------------------------+ -//| MACD_SuperSmoother_Pro.mq5 | -//| Copyright 2025, xxxxxxxx| -//| | -//+------------------------------------------------------------------+ -#property copyright "Copyright 2025, xxxxxxxx" -#property link "" -#property version "1.00" -#property description "MACD variant using John Ehlers' SuperSmoother for all moving averages." -#property description "Supports Standard and Heikin Ashi price sources." - -#property indicator_separate_window -#property indicator_buffers 3 -#property indicator_plots 3 - -#property indicator_label1 "Histogram" -#property indicator_type1 DRAW_HISTOGRAM -#property indicator_color1 clrSilver -#property indicator_width1 1 -#property indicator_label2 "MACD" -#property indicator_type2 DRAW_LINE -#property indicator_color2 clrDodgerBlue -#property indicator_style2 STYLE_SOLID -#property indicator_width2 1 -#property indicator_label3 "Signal" -#property indicator_type3 DRAW_LINE -#property indicator_color3 clrOrangeRed -#property indicator_style3 STYLE_SOLID -#property indicator_width3 1 - -#include - -//--- Input Parameters --- -input int InpFastPeriod = 12; -input int InpSlowPeriod = 26; -input int InpSignalPeriod = 9; -input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD; - -//--- Indicator Buffers --- -double BufferMACD_Histogram[], BufferMACDLine[], BufferSignalLine[]; - -//--- Global calculator object --- -CMACDSuperSmootherCalculator *g_calculator; - -//+------------------------------------------------------------------+ -int OnInit() - { - SetIndexBuffer(0, BufferMACD_Histogram, INDICATOR_DATA); - SetIndexBuffer(1, BufferMACDLine, INDICATOR_DATA); - SetIndexBuffer(2, BufferSignalLine, INDICATOR_DATA); - ArraySetAsSeries(BufferMACD_Histogram, false); - ArraySetAsSeries(BufferMACDLine, false); - ArraySetAsSeries(BufferSignalLine, false); - - if(InpSourcePrice <= PRICE_HA_CLOSE) - g_calculator = new CMACDSuperSmootherCalculator_HA(); - else - g_calculator = new CMACDSuperSmootherCalculator(); - - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpFastPeriod, InpSlowPeriod, InpSignalPeriod)) - { - Print("Failed to create or initialize MACD SuperSmoother Calculator."); - return(INIT_FAILED); - } - - string short_name = StringFormat("MACD SS%s(%d,%d,%d)", (InpSourcePrice <= PRICE_HA_CLOSE ? " HA" : ""), InpFastPeriod, InpSlowPeriod, InpSignalPeriod); - IndicatorSetString(INDICATOR_SHORTNAME, short_name); - - int draw_begin = InpSlowPeriod + InpSignalPeriod; - PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, draw_begin); - PlotIndexSetInteger(1, PLOT_DRAW_BEGIN, InpSlowPeriod); - PlotIndexSetInteger(2, PLOT_DRAW_BEGIN, draw_begin); - IndicatorSetInteger(INDICATOR_DIGITS, _Digits); - - return(INIT_SUCCEEDED); - } - -//+------------------------------------------------------------------+ -void OnDeinit(const int reason) { if(CheckPointer(g_calculator) != POINTER_INVALID) delete g_calculator; } - -//+------------------------------------------------------------------+ -int OnCalculate(const int rates_total, const int, const datetime&[], const double &open[], const double &high[], const double &low[], const double &close[], const long&[], const long&[], const int&[]) - { - if(CheckPointer(g_calculator) == POINTER_INVALID) - return 0; - ENUM_APPLIED_PRICE price_type = (InpSourcePrice <= PRICE_HA_CLOSE) ? (ENUM_APPLIED_PRICE)(-(int)InpSourcePrice) : (ENUM_APPLIED_PRICE)InpSourcePrice; - g_calculator.Calculate(rates_total, open, high, low, close, price_type, BufferMACDLine, BufferSignalLine, BufferMACD_Histogram); - return(rates_total); - } -//+------------------------------------------------------------------+ -//+------------------------------------------------------------------+