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.