MQL5-Google-Onedrive/mt5/MQL5
google-labs-jules[bot] 7db3244400 feat(perf): Add New-Bar Check to OnTick
**💡 What:** Added a lightweight check at the beginning of the `OnTick()` function to exit early if a new bar has not formed.

**🎯 Why:** The `OnTick()` function runs on every price tick, but the trading logic only needs to be evaluated once per bar. Without this check, the EA performs expensive calculations (like `CopyRates`) unnecessarily, consuming significant CPU resources.

**📊 Impact:** This change will dramatically reduce the EA's CPU usage. The expensive logic will now run only once per bar instead of on every tick, leading to a potential reduction of over 99% in function calls depending on market volatility.

**🔬 Measurement:** The improvement can be verified by observing the CPU usage of the MetaTrader 5 terminal when this EA is running on a chart. Before the change, CPU usage would spike with every tick. After the change, it will remain low, with small spikes only at the opening of a new bar.
2026-01-09 19:30:20 +00:00
..
Experts feat(perf): Add New-Bar Check to OnTick 2026-01-09 19:30:20 +00:00
Indicators feat: Add SL/TP modes and risk management to EA 2025-12-26 08:17:39 +00:00