MQL5-Google-Onedrive/mt5
google-labs-jules[bot] 52be3a8638 Bolt: Optimize Expert Advisor performance and robustness
- Consolidate trade counting and profit calculation into a single history scan in `UpdateDailyStatistics()`.
- Refactor `OnTrade()` to remove redundant `HistorySelect` and secondary history loops.
- Optimize `IsTradingAllowed()` with fast math for hour extraction, replacing expensive `TimeToStruct()` calls.
- Reduce terminal API calls in `CheckDailyLimits()` by fetching account balance once.
- Improve robustness of trade counting by using `DEAL_ENTRY_IN` check.
- Reuse pre-fetched `TimeCurrent()` value across `OnTick()` and its sub-functions.

Impact: Reduces redundant O(N) history scans and minimizes expensive terminal API calls on every price tick.

Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>
2026-02-02 20:37:16 +00:00
..
MQL5 Bolt: Optimize Expert Advisor performance and robustness 2026-02-02 20:37:16 +00:00