Commit graph

2 commits

Author SHA1 Message Date
google-labs-jules[bot]
8e98b834e8 Bolt: Optimize EA hot-path and daily limit logic
This commit implements several performance optimizations for the ExpertMAPSARSizeOptimized_Improved Expert Advisor:

1.  **Environment API Caching**: Implemented a 1-second cache for `TerminalInfoInteger` and `MQLInfoInteger` calls in `IsTradingAllowed` to reduce terminal API overhead during rapid price ticks.
2.  **Fast Time Filtering**: Replaced expensive `TimeToStruct` and hour-extraction logic with pre-calculated seconds since midnight (`g_startSeconds`, `g_endSeconds`) and fast modulo arithmetic (`TimeCurrent() % 86400`).
3.  **Dynamic Daily Limits**: Optimized daily limit checks by pre-calculating currency bounds. Limits are now correctly recalculated at the start of each new trading day based on the starting balance, ensuring accuracy for multi-day sessions.
4.  **Log Throttling**: Added a daily throttle for "limit reached" alerts to prevent log flooding.
5.  **Fast Day-Start Calculation**: Optimized `todayStart` calculation using integer math instead of structure conversions.

These changes significantly reduce the CPU footprint of the `OnTick` path while maintaining (and improving) the logical correctness of risk management features.
2026-02-21 20:43:46 +00:00
google-labs-jules[bot]
ea261ed334 Merge feature branch, cleanup dependencies, and sanitize credentials
Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>
2026-01-28 10:24:13 +00:00