mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 06:30:56 +00:00
💡 What: This optimization introduces an efficient new-bar check at the beginning of the `OnTick()` function. Instead of copying 400 bars on every price tick, it now copies only two to determine if a new bar has formed. 🎯 Why: The previous implementation performed an expensive `CopyRates()` operation on every tick, leading to unnecessary CPU load, as the core logic only needs to run once per bar. 📊 Impact: This change dramatically reduces the EA's CPU usage. The main logic now only executes on the first tick of a new bar, avoiding costly operations for the vast majority of ticks. This leads to a more efficient and responsive EA, especially in volatile markets. 🔬 Measurement: The performance improvement can be verified by observing the EA's execution time in the MetaTrader 5 Strategy Tester or by monitoring CPU usage of the terminal when the EA is running on a live chart. A significant drop in processing time per tick is expected. |
||
|---|---|---|
| .. | ||
| MQL5 | ||