diff --git a/src/SniperEA.mq5 b/src/SniperEA.mq5 index 9bbc5b5..e111a25 100644 --- a/src/SniperEA.mq5 +++ b/src/SniperEA.mq5 @@ -3149,14 +3149,14 @@ bool UpdateMultiTimeframeAnalysis(string symbol) { LogDebug("Updating Multi-Timeframe Analysis for " + symbol); - bool success = true; + bool any_success = false; bool updated = false; // Update M1 analysis (most frequent) if (IsNewBar(symbol, PERIOD_M1) || !MTF_Data_M1.is_valid) { bool m1_result = UpdateTimeframeData(symbol, MTF_Data_M1); - success &= m1_result; + any_success |= m1_result; // Use OR logic - success if ANY timeframe works updated |= m1_result; } @@ -3164,7 +3164,7 @@ bool UpdateMultiTimeframeAnalysis(string symbol) if (IsTimeframeUpdateNeeded(symbol, MTF_Data_M15) || !MTF_Data_M15.is_valid) { bool m15_result = UpdateTimeframeData(symbol, MTF_Data_M15); - success &= m15_result; + any_success |= m15_result; // Use OR logic - success if ANY timeframe works updated |= m15_result; } @@ -3172,7 +3172,7 @@ bool UpdateMultiTimeframeAnalysis(string symbol) if (IsTimeframeUpdateNeeded(symbol, MTF_Data_H4) || !MTF_Data_H4.is_valid) { bool h4_result = UpdateTimeframeData(symbol, MTF_Data_H4); - success &= h4_result; + any_success |= h4_result; // Use OR logic - success if ANY timeframe works updated |= h4_result; } @@ -3180,7 +3180,7 @@ bool UpdateMultiTimeframeAnalysis(string symbol) if (IsTimeframeUpdateNeeded(symbol, MTF_Data_D1) || !MTF_Data_D1.is_valid) { bool d1_result = UpdateTimeframeData(symbol, MTF_Data_D1); - success &= d1_result; + any_success |= d1_result; // Use OR logic - success if ANY timeframe works updated |= d1_result; } @@ -3188,7 +3188,7 @@ bool UpdateMultiTimeframeAnalysis(string symbol) if (IsTimeframeUpdateNeeded(symbol, MTF_Data_W1) || !MTF_Data_W1.is_valid) { bool w1_result = UpdateTimeframeData(symbol, MTF_Data_W1); - success &= w1_result; + any_success |= w1_result; // Use OR logic - success if ANY timeframe works updated |= w1_result; } @@ -3197,9 +3197,9 @@ bool UpdateMultiTimeframeAnalysis(string symbol) LogDebug("Multi-Timeframe Analysis updated for " + symbol); } - // Return success (true) even if no updates were needed - // Only return false if there was an actual error during updates - return success; + // Return success if ANY timeframe update worked, or if no updates were needed + // Only return false if ALL timeframe updates failed AND updates were attempted + return any_success || !updated; } bool IsTimeframeUpdateNeeded(string symbol, MarketStructureData &mtf_data)