MQL5-Google-Onedrive/mt5/MQL5
google-labs-jules[bot] 4f771a1594 Bolt: Use Ask/Bid variables for faster price retrieval in OnTick
💡 What:
Replaced `SymbolInfoDouble(_Symbol, SYMBOL_ASK)` and `SymbolInfoDouble(_Symbol, SYMBOL_BID)` with the direct, pre-defined variables `Ask` and `Bid` inside the performance-critical `OnTick` function.

🎯 Why:
The `OnTick` function executes on every incoming market tick. The `SymbolInfoDouble()` function, while reliable, introduces overhead with each call. In contrast, the MQL5 engine provides pre-cached `Ask` and `Bid` global variables that are significantly faster to access. This change eliminates unnecessary function call overhead on a very hot path.

📊 Impact:
This micro-optimization reduces the execution time of each `OnTick` cycle. While the per-call saving is small, it accumulates over thousands of ticks, leading to a more responsive Expert Advisor, especially in volatile market conditions. This ensures the EA can process market data and execute logic with minimal latency.

🔬 Measurement:
The performance improvement can be verified by profiling the Expert Advisor in the MetaTrader 5 Strategy Tester. By comparing the execution time of the `OnTick` function before and after the change under the "Every tick" model, a profiler would show a decrease in the time spent retrieving bid/ask prices.
2025-12-28 10:32:58 +00:00
..
Experts Bolt: Use Ask/Bid variables for faster price retrieval in OnTick 2025-12-28 10:32:58 +00:00
Indicators feat: Add SL/TP modes and risk management to EA 2025-12-26 08:17:39 +00:00