diff --git a/Indicators/MyIndicators/Authors/Ehlers/1_Smoothers/ZeroLag_EMA_Pro.mq5 b/Indicators/MyIndicators/Authors/Ehlers/1_Smoothers/ZeroLag_EMA_Pro.mq5 index 5290d82..fac3039 100644 --- a/Indicators/MyIndicators/Authors/Ehlers/1_Smoothers/ZeroLag_EMA_Pro.mq5 +++ b/Indicators/MyIndicators/Authors/Ehlers/1_Smoothers/ZeroLag_EMA_Pro.mq5 @@ -1,10 +1,9 @@ //+------------------------------------------------------------------+ //| ZeroLag_EMA_Pro.mq5 | //| Copyright 2025, xxxxxxxx| -//| | //+------------------------------------------------------------------+ #property copyright "Copyright 2025, xxxxxxxx" -#property version "2.00" // Added Ehlers' optimized gain (Error Correcting) mode +#property version "2.00" // Optimized for incremental calculation #property description "Zero-Lag Exponential Moving Average (ZLEMA). Supports standard" #property description "and Ehlers' optimized gain (Error Correcting) modes." @@ -15,7 +14,7 @@ #property indicator_type1 DRAW_LINE #property indicator_color1 clrMediumTurquoise #property indicator_style1 STYLE_SOLID -#property indicator_width1 1 +#property indicator_width1 2 #include @@ -69,7 +68,7 @@ void OnDeinit(const int reason) } //+------------------------------------------------------------------+ -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&[]) +int OnCalculate(const int rates_total, const int prev_calculated, 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; @@ -80,7 +79,7 @@ int OnCalculate(const int rates_total, const int, const datetime&[], const doubl else price_type = (ENUM_APPLIED_PRICE)InpSourcePrice; - g_calculator.Calculate(rates_total, price_type, open, high, low, close, BufferZLEMA); + g_calculator.Calculate(rates_total, prev_calculated, price_type, open, high, low, close, BufferZLEMA); return(rates_total); } //+------------------------------------------------------------------+