From ca887b441497b52328c253133dd5e0168f30b489 Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Fri, 19 Dec 2025 15:22:07 +0100 Subject: [PATCH] refactor: Fixed uninitialized buffer bug on W1 --- Include/MyIncludes/MovingAverage_Ribbon_MTF_Calculator.mqh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Include/MyIncludes/MovingAverage_Ribbon_MTF_Calculator.mqh b/Include/MyIncludes/MovingAverage_Ribbon_MTF_Calculator.mqh index ce3373e..aeecbc5 100644 --- a/Include/MyIncludes/MovingAverage_Ribbon_MTF_Calculator.mqh +++ b/Include/MyIncludes/MovingAverage_Ribbon_MTF_Calculator.mqh @@ -1,7 +1,6 @@ //+------------------------------------------------------------------+ //| MovingAverage_Ribbon_MTF_Calculator.mqh| -//| Engine for the fully customizable MTF MA Ribbon. | -//| Contains both the Line Helper and the Ribbon Manager. | +//| VERSION 2.20: Fixed uninitialized buffer bug on W1. | //| Copyright 2025, xxxxxxxx | //+------------------------------------------------------------------+ #property copyright "Copyright 2025, xxxxxxxx" @@ -82,8 +81,12 @@ void CSingleMAMTFCalculator::Calculate(int rates_total, int prev_calculated, con if(CheckPointer(m_calculator) == POINTER_INVALID) return; +// CRITICAL FIX: Initialize buffer with EMPTY_VALUE on full recalc. if(prev_calculated == 0) + { + ArrayInitialize(output_buffer, EMPTY_VALUE); m_htf_prev_calc = 0; + } //--- MTF MODE --- if(m_is_mtf)