mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 08:30:56 +00:00
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. |
||
|---|---|---|
| .. | ||
| EXNESS_GenX_Trader.mq5 | ||
| ExpertMACD_Enhanced.mq5 | ||
| ExpertMAMA_Enhanced.mq5 | ||
| ExpertMAPSAR_Enhanced.mq5 | ||
| ExpertMAPSAR_Filtered.mq5 | ||
| ExpertMAPSAR_Improved.mq5 | ||
| ExpertMAPSAR_RiskBased.mq5 | ||
| ExpertMAPSARSizeOptimized.mq5 | ||
| ExpertMAPSARSizeOptimized_Improved.mq5 | ||
| SMC_TrendBreakout_MTF_EA.mq5 | ||