mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 06:10:57 +00:00
**What:** The `MqlRates rates[400]` array declaration is moved from the top of the `OnTick` function into the conditional `if` block where it is actually used. **Why:** The `OnTick` function is a performance-critical "hot path." The previous implementation allocated a large array on the stack on every single tick, even if the function exited early and the array was never used. This created unnecessary memory overhead on the most common, lightweight execution path. **Impact:** This change reduces stack memory allocation for the majority of `OnTick` calls. While the impact per call is small, it accumulates significantly over time in a high-frequency trading context, leading to a more efficient EA. **Measurement:** The improvement can be observed by profiling the EA's execution time per tick, particularly in scenarios where the `UseSMC` and `SLMode == SL_SWING` inputs are disabled. The optimized code will show a small but consistent reduction in execution time on the lighter path. |
||
|---|---|---|
| .. | ||
| MQL5 | ||