refactor: Fixed uninitialized buffer bug on W1

This commit is contained in:
Toh4iem9
2025-12-19 15:22:07 +01:00
parent 51fd426b56
commit ca887b4414
@@ -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)