mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 10:00:57 +00:00
💡 What: This optimization refactors the `OnTick` function to check for primary trade signals (Donchian breakout or SMC structure break) *before* calling the multi-timeframe (MTF) confirmation function (`GetMTFDir`). 🎯 Why: The `GetMTFDir()` function can be computationally expensive as it involves fetching and processing data from a different timeframe. Previously, this function was called on every new bar, even when no potential trade signal was present on the primary timeframe. 📊 Impact: This change significantly reduces unnecessary calculations. The expensive MTF confirmation logic now only runs when a primary signal is found, leading to a much more efficient `OnTick` execution path, especially in active markets. 🔬 Measurement: The improvement can be observed by profiling the Expert Advisor in the MetaTrader 5 Strategy Tester. The total execution time over a backtest period will be lower with this change, as the number of calls to `GetMTFDir` is drastically reduced. |
||
|---|---|---|
| .. | ||
| MQL5 | ||