From 7c97d4687a13316187e67af18a06712c9bd51791 Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Sun, 4 Jan 2026 10:34:00 +0100 Subject: [PATCH] refactor(indicators): Optimized for incremental calculation --- .../Authors/Ehlers/1_Smoothers/ZeroLag_EMA_Pro.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Indicators/MyIndicators/Authors/Ehlers/1_Smoothers/ZeroLag_EMA_Pro.md b/Indicators/MyIndicators/Authors/Ehlers/1_Smoothers/ZeroLag_EMA_Pro.md index c0c64a4..c094dad 100644 --- a/Indicators/MyIndicators/Authors/Ehlers/1_Smoothers/ZeroLag_EMA_Pro.md +++ b/Indicators/MyIndicators/Authors/Ehlers/1_Smoothers/ZeroLag_EMA_Pro.md @@ -38,9 +38,16 @@ This method uses a feedback loop to continuously adjust the filter's responsiven ## 3. MQL5 Implementation Details +Our MQL5 implementation follows a modern, object-oriented design to ensure stability and performance. + * **Dual-Mode Calculator (`ZeroLag_EMA_Calculator.mqh`):** The calculator class contains both calculation methods, selectable via a boolean flag during initialization. + +* **Optimized Incremental Calculation (O(1)):** + Unlike basic implementations that recalculate the entire history on every tick, this indicator employs an intelligent incremental algorithm. + * **State Tracking:** It utilizes `prev_calculated` to process only new bars. + * **Persistent Buffers:** The internal buffers (for EMA1/EMA2 or EMA/EC) persist their state between ticks. This allows the recursive calculations to continue seamlessly from the last known values without re-processing the entire history. + * **Heikin Ashi Integration:** An inherited `_HA` class allows both modes to be calculated seamlessly on smoothed Heikin Ashi data. -* **Stability via Full Recalculation:** Both modes are recursive. The indicator employs a full recalculation on every `OnCalculate` call to ensure stability. ## 4. Parameters