mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 08:20:58 +00:00
💡 What: Adds a lightweight `iTime()` check at the beginning of the `OnTick()` function. This verifies if a new bar has formed on the signal timeframe before executing more resource-intensive functions like `CopyRates()`. 🎯 Why: The `OnTick()` function is called for every price tick, which can be very frequent. The previous implementation performed an expensive `CopyRates()` call on every tick, even though the trading logic only needed to run once per bar. This caused significant and unnecessary CPU load. 📊 Impact: This change drastically reduces the EA's CPU usage. The EA now exits immediately on most ticks after a very cheap check, only proceeding with heavy processing when a new candle appears. This makes the EA more efficient and responsive, especially in volatile market conditions. 🔬 Measurement: The improvement can be measured by profiling the EA in the MetaTrader 5 Strategy Tester or by monitoring the terminal's CPU usage with the EA attached to a live chart. The average execution time of the `OnTick` function will be significantly lower. |
||
|---|---|---|
| .. | ||
| MQL5 | ||