forked from LengKundee/MQL5-Google-Onedrive
💡 What: Added a lightweight new-bar check using `iTime()` at the beginning of the `OnTick()` function. 🎯 Why: The `OnTick()` function was executing expensive data copying (`CopyRates`) and calculations on every single price tick, leading to unnecessary CPU load. 📊 Impact: This change ensures the main trading logic only runs once per bar, drastically reducing redundant computations and improving the EA's overall efficiency. For a typical currency pair, this can reduce the number of times the core logic is run by a factor of 10-100x or more, depending on market volatility. 🔬 Measurement: The performance improvement can be verified by observing the CPU usage of the terminal running the EA, especially during volatile market conditions. Before the change, CPU usage would spike on every tick. After the change, CPU usage will remain low and only show a small increase at the beginning of each new bar. |
||
|---|---|---|
| .. | ||
| SMC_TrendBreakout_MTF_EA.mq5 | ||