mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 08:30:56 +00:00
💡 What: Consolidated two `CopyRates` calls into a single call within the `OnTick()` function in the `SMC_TrendBreakout_MTF_EA.mq5` Expert Advisor. 🎯 Why: The `OnTick()` function is a performance-critical hot path that runs on every price tick. The original code made two separate, expensive calls to fetch historical price data (`CopyRates`). This redundancy creates unnecessary overhead. By fetching all required bar data in a single call, we reduce I/O and processing, making the EA more efficient. 📊 Impact: This change reduces the number of data-fetching operations by 50% on every new bar, leading to a small but meaningful reduction in tick processing time. This improves the overall responsiveness and efficiency of the Expert Advisor. 🔬 Measurement: The improvement can be verified by profiling the `OnTick` function's execution time before and after the change in the MetaTrader 5 Strategy Tester or a live environment. The code is visibly more efficient by inspection, as a redundant function call has been removed. |
||
|---|---|---|
| .. | ||
| Experts | ||
| Indicators | ||