forked from LengKundee/MQL5-Google-Onedrive
💡 What: This change optimizes the `OnTick()` function in the main EA file. It consolidates two separate `CopyRates()` calls into a single call and replaces `SymbolInfoDouble()` calls with the faster, pre-defined `Ask` and `Bid` global variables. 🎯 Why: The `OnTick()` function is a performance-critical "hot path" that runs on every price tick. Redundant function calls and data-copying operations within this function can lead to unnecessary processing overhead and potential delays in trade execution. 📊 Impact: Reduces the number of expensive history-accessing operations and function calls on every tick. This leads to a more efficient EA, consuming fewer CPU cycles and ensuring that trade logic executes as quickly as possible. 🔬 Measurement: The improvement can be verified by profiling the EA in the MetaTrader 5 Strategy Tester. The optimized version will show a slightly lower total execution time over a long backtest period compared to the original version. The code is also demonstrably cleaner and more efficient by inspection. |
||
|---|---|---|
| .. | ||
| Experts | ||
| Indicators | ||