mirror of
https://github.com/softwaredevelop/mql5.git
synced 2026-08-20 07:48:06 +00:00
refactor: Ehlers_Smoother_Calculator
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
//| Copyright 2025, xxxxxxxx|
|
//| Copyright 2025, xxxxxxxx|
|
||||||
//+------------------------------------------------------------------+
|
//+------------------------------------------------------------------+
|
||||||
#property copyright "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 description "John Ehlers' SuperSmoother and UltimateSmoother filters."
|
||||||
|
|
||||||
#property indicator_chart_window
|
#property indicator_chart_window
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
#include <MyIncludes\Ehlers_Smoother_Calculator.mqh>
|
#include <MyIncludes\Ehlers_Smoother_Calculator.mqh>
|
||||||
|
|
||||||
//--- Input Parameters ---
|
//--- Input Parameters ---
|
||||||
input ENUM_SMOOTHER_TYPE InpSmootherType = SUPERSMOOTHER; // Type of smoother
|
input ENUM_SMOOTHER_TYPE InpSmootherType = SUPERSMOOTHER;
|
||||||
input int InpPeriod = 20; // Critical Period for the filter
|
input int InpPeriod = 20;
|
||||||
input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD;
|
input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD;
|
||||||
|
|
||||||
//--- Indicator Buffers ---
|
//--- Indicator Buffers ---
|
||||||
@@ -47,13 +47,13 @@ int OnInit()
|
|||||||
IndicatorSetString(INDICATOR_SHORTNAME, StringFormat("%s(%d)", name, InpPeriod));
|
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.");
|
Print("Failed to initialize Ehlers Smoother Calculator.");
|
||||||
return(INIT_FAILED);
|
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);
|
IndicatorSetInteger(INDICATOR_DIGITS, _Digits);
|
||||||
|
|
||||||
return(INIT_SUCCEEDED);
|
return(INIT_SUCCEEDED);
|
||||||
|
|||||||
Reference in New Issue
Block a user