From a34cad5d07b42bea43eced4a7ee2ba436ca117a6 Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Tue, 25 Nov 2025 15:58:58 +0100 Subject: [PATCH] refactor: Added selectable signal line type --- .../MACD_Laguerre_Histogram_Pro.mq5 | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Indicators/MyIndicators/Authors/Ehlers/5_Ehlers_Hybrids/MACD_Laguerre_Histogram_Pro.mq5 b/Indicators/MyIndicators/Authors/Ehlers/5_Ehlers_Hybrids/MACD_Laguerre_Histogram_Pro.mq5 index 3839621..cafabb9 100644 --- a/Indicators/MyIndicators/Authors/Ehlers/5_Ehlers_Hybrids/MACD_Laguerre_Histogram_Pro.mq5 +++ b/Indicators/MyIndicators/Authors/Ehlers/5_Ehlers_Hybrids/MACD_Laguerre_Histogram_Pro.mq5 @@ -5,8 +5,8 @@ //+------------------------------------------------------------------+ #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 version "1.10" // Added selectable signal line type +#property description "Histogram for the Laguerre MACD with a selectable signal line." #property indicator_separate_window #property indicator_buffers 1 @@ -23,12 +23,13 @@ //--- 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 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 ENUM_SMOOTHING_METHOD_LAGUERRE InpSignalMAType = SMOOTH_Laguerre; +input int InpSignalPeriod = 9; +input double InpSignalGamma = 0.5; input group "Price Source" input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD; @@ -50,15 +51,16 @@ int OnInit() else g_calculator = new CMACDLaguerreHistogramCalculator(); - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpGamma1, InpGamma2, InpSignalPeriod, InpSignalMAType)) + if(CheckPointer(g_calculator) == POINTER_INVALID || + !g_calculator.Init(InpGamma1, InpGamma2, InpSignalGamma, 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)); + StringReplace(ma_name, "SMOOTH_", ""); + IndicatorSetString(INDICATOR_SHORTNAME, StringFormat("Laguerre Histo(%s)", ma_name)); PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, 2 + InpSignalPeriod); IndicatorSetInteger(INDICATOR_DIGITS, _Digits);