mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 08:20:58 +00:00
What: Added a lightweight check using `iTime()` at the beginning of the `OnTick()` function to ensure the main logic only runs when a new bar has formed. Why: The original code executed the expensive `CopyRates()` function and subsequent calculations on every incoming price tick, causing unnecessary CPU load. For a bar-based strategy, these calculations are only required once per bar. Impact: Reduces CPU consumption of the Expert Advisor significantly, especially on volatile symbols with many ticks per bar. This leads to better overall terminal performance and more precise execution timing. Measurement: The improvement can be verified by observing the EA's execution frequency in the terminal's "Experts" log. Before the change, log entries would appear on every tick. After the change, they will only appear once per new bar on the signal timeframe. |
||
|---|---|---|
| .. | ||
| SMC_TrendBreakout_MTF_EA.mq5 | ||