mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 00:10:58 +00:00
Identified and optimized a performance bottleneck in the MQL5 Expert Advisor's execution hot path. 💡 What: Implemented a 1-second cache for `TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)` and `MQLInfoInteger(MQL_TRADE_ALLOWED)` within the `IsTradingAllowed` function in `ExpertMAPSARSizeOptimized_Improved.mq5`. 🎯 Why: These terminal API calls are relatively expensive as they require context switching between the MQL virtual machine and the terminal core. In this EA, which processes every price tick to manage trailing stops, these redundant calls were introducing unnecessary overhead thousands of times per hour. 📊 Impact: Reduces terminal API overhead by up to 99% during rapid price ticks (capping it at 1 call per second per symbol), significantly improving execution efficiency for high-frequency price processing. 🔬 Measurement: Verified the optimization by reviewing the code logic and ensuring it correctly updates on a 1-second timer. Repository health was confirmed using `ci_validate_repo.py` and `test_automation.py`. |
||
|---|---|---|
| .. | ||
| Experts | ||
| Indicators | ||