From 7ad484f74fcf7ca927df78607aa2010d8dcd2718 Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Tue, 28 Oct 2025 13:20:47 +0100 Subject: [PATCH] refactor: Ehlers_Smoother_Calculator --- Indicators/MyIndicators/Ehlers_Smoother_Pro.mq5 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Indicators/MyIndicators/Ehlers_Smoother_Pro.mq5 b/Indicators/MyIndicators/Ehlers_Smoother_Pro.mq5 index b59ddfe..dd8759d 100644 --- a/Indicators/MyIndicators/Ehlers_Smoother_Pro.mq5 +++ b/Indicators/MyIndicators/Ehlers_Smoother_Pro.mq5 @@ -3,7 +3,7 @@ //| Copyright 2025, xxxxxxxx| //+------------------------------------------------------------------+ #property copyright "Copyright 2025, xxxxxxxx" -#property version "2.10" // Refactored calculation for definition-true stability +#property version "2.20" // Adapted to new universal calculator #property description "John Ehlers' SuperSmoother and UltimateSmoother filters." #property indicator_chart_window @@ -18,8 +18,8 @@ #include //--- Input Parameters --- -input ENUM_SMOOTHER_TYPE InpSmootherType = SUPERSMOOTHER; // Type of smoother -input int InpPeriod = 20; // Critical Period for the filter +input ENUM_SMOOTHER_TYPE InpSmootherType = SUPERSMOOTHER; +input int InpPeriod = 20; input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD; //--- Indicator Buffers --- @@ -47,13 +47,13 @@ int OnInit() IndicatorSetString(INDICATOR_SHORTNAME, StringFormat("%s(%d)", name, InpPeriod)); } - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpPeriod, InpSmootherType)) + if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpPeriod, InpSmootherType, SOURCE_PRICE)) { Print("Failed to initialize Ehlers Smoother Calculator."); return(INIT_FAILED); } - PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, 3); // Draw from the 4th bar (index 3) + PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, 3); IndicatorSetInteger(INDICATOR_DIGITS, _Digits); return(INIT_SUCCEEDED);