MQL5-Google-Onedrive/mt5/MQL5/Experts
google-labs-jules[bot] 99bc51c770 Bolt: Cache ask/bid prices in OnTick to reduce redundant calls
💡 What: This change caches the `ask` and `bid` prices at the beginning of the `OnTick()` function and passes them as arguments to the `OpenBuyTrade()` and `OpenSellTrade()` functions. This eliminates redundant calls to `SymbolInfoDouble()` within the trade execution functions.

🎯 Why: The `OnTick()` function is a performance-critical hot path. The original code made unnecessary, duplicate calls to fetch symbol price information, adding overhead to every tick that resulted in a trade signal.

📊 Impact: Reduces redundant function calls in the `OnTick` execution path. While a micro-optimization, this improves the overall efficiency of the EA by ensuring price information is fetched only once per tick.

🔬 Measurement: The code's correctness is verified by the existing automated test suite. The performance impact can be confirmed by profiling the EA in the MT5 Strategy Tester, where a slight reduction in the execution time of `OnTick` can be observed.
2026-01-24 10:44:27 +00:00
..
ExpertMAPSARSizeOptimized_Improved.mq5 Improve ExpertMAPSARSizeOptimized EA with enhanced risk management, logging, and safety features 2026-01-19 14:19:52 +07:00
SMC_TrendBreakout_MTF_EA.mq5 Bolt: Cache ask/bid prices in OnTick to reduce redundant calls 2026-01-24 10:44:27 +00:00