mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 12:00:56 +00:00
💡 What: Implemented an "early exit" in the `OnTick()` function. It now uses the lightweight `CopyTime()` to check if a new bar has formed on the signal timeframe before executing any of the expensive data copying and trading logic. 🎯 Why: The `OnTick()` function is called on every price tick, which can be multiple times per second. The previous implementation ran heavy calculations (like `CopyRates`) on every single tick, even though the bar-based logic only needs to run once per bar. This caused significant and unnecessary CPU load. 📊 Impact: This change dramatically reduces the EA's CPU usage. Instead of running complex logic hundreds or thousands of times per minute, it now only runs it once when a new bar appears. This leads to a more efficient and stable EA, especially in volatile markets or on lower timeframes. 🔬 Measurement: The performance improvement can be verified by monitoring the CPU usage of the MetaTrader 5 terminal when the EA is running on a chart, especially on a lower timeframe like M1. A noticeable drop in CPU consumption should be observed. |
||
|---|---|---|
| .. | ||
| MQL5 | ||