mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 08:10:56 +00:00
💡 What: Implemented an early-exit guard at the beginning of the `OnTick()` function. This check uses the lightweight `iTime()` function to see if a new bar has formed on the signal timeframe before executing the rest of the function's logic. 🎯 Why: Previously, the EA would execute expensive data-copying and analysis functions (`CopyRates`, `CopyBuffer`, etc.) on every single price tick. This is highly inefficient, as the trading logic is bar-based and only needs to be evaluated once when a new bar opens. 📊 Impact: This change drastically reduces the EA's CPU consumption. By preventing the main logic from running thousands of times unnecessarily between bars, the EA becomes significantly more efficient and responsive, especially in volatile markets. 🔬 Measurement: The performance improvement can be measured by running the EA in the MetaTrader 5 Strategy Tester with profiling enabled. A comparison of the profiling reports before and after the change will show a dramatic reduction in the number of calls to functions within `OnTick` and a lower overall execution time. |
||
|---|---|---|
| .. | ||
| MQL5 | ||