mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 16:59:14 +00:00
3 lines
821 B
Markdown
3 lines
821 B
Markdown
|
|
## 2024-07-25 - MQL5 Native Functions vs. Manual Loops
|
||
|
|
**Learning:** I incorrectly assumed that replacing MQL5's native, compiled functions (e.g., `iHighest`, `iLowest`) with a manual `for` loop in MQL5 script would be more performant due to avoiding "function call overhead." The code review made it clear that this is a false premise. The native functions are highly optimized C++ code, and a manual loop in the higher-level MQL5 is significantly slower and can introduce bugs (like using a hardcoded magic number for initialization).
|
||
|
|
**Action:** Always trust the platform's built-in, natively compiled functions for performance-critical operations over manual script loops. Do not attempt to micro-optimize these calls without concrete benchmark data proving an improvement. Always favor the robust, built-in solution.
|