mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 10:20:57 +00:00
Replaced `SymbolInfoDouble()` with predefined `Ask`/`Bid` variables and consolidated `CopyRates()` calls. - **What:** This commit introduces two key performance optimizations to the `OnTick` function, a critical hot path in the MQL5 Expert Advisor. - **Why:** The original code used inefficient methods for fetching price and bar data, leading to unnecessary function call overhead and redundant I/O operations on every price tick. - **Impact:** These changes reduce the execution time of the `OnTick` function, leading to faster strategy execution and reduced resource consumption. Using predefined variables is significantly faster than function calls, and a single `CopyRates` call is more efficient than two. - **Measurement:** Performance improvement can be verified by profiling the EA's `OnTick` execution time in the MetaTrader 5 Strategy Tester before and after the changes. A noticeable reduction in the average execution time per tick is expected. |
||
|---|---|---|
| .. | ||
| Experts | ||
| Indicators | ||