forked from LengKundee/MQL5-Google-Onedrive
💡 What: This optimization introduces a lightweight check using `iTime()` at the beginning of the `OnTick()` function. 🎯 Why: The `OnTick()` function runs on every price tick. The previous implementation called the expensive `CopyRates()` function on every tick, which is inefficient. This change ensures that the main logic of the EA only runs when a new bar has actually formed on the signal timeframe. 📊 Impact: This significantly reduces the EA's CPU usage, as the expensive `CopyRates()` call and subsequent calculations are now executed only once per bar instead of on every tick. 🔬 Measurement: The improvement can be verified by observing the EA's execution time in the MetaTrader 5 profiler. The number of calls to `CopyRates` will be drastically lower, leading to a much lower overall execution time. |
||
|---|---|---|
| .. | ||
| Experts | ||
| Indicators | ||