mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 04:30:56 +00:00
💡 What: This optimization introduces a lightweight new-bar check at the very beginning of the `OnTick()` function using `iTime()`. 🎯 Why: Previously, the EA performed an expensive `CopyRates()` call on every single incoming price tick, even when no new bar had formed. This caused significant and unnecessary CPU load, as the core trading logic only needs to be evaluated once per bar. 📊 Impact: This change dramatically improves performance by ensuring the main `OnTick()` logic only executes once per new bar on the signal timeframe. This leads to a substantial reduction in CPU usage, making the EA more efficient and responsive. 🔬 Measurement: The performance improvement can be measured by running the EA in the MetaTrader 5 Strategy Tester with "Profile" mode enabled. Comparing the execution time of the `OnTick` function before and after this change will show a significant decrease in the total time spent and the number of calls to expensive functions like `CopyRates`. |
||
|---|---|---|
| .. | ||
| Experts | ||
| Indicators | ||