MQL5-Google-Onedrive/mt5
google-labs-jules[bot] cd6628e4ab Bolt: Defer expensive MTF confirmation until after primary signal
💡 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.
2026-01-12 19:06:03 +00:00
..
MQL5 Bolt: Defer expensive MTF confirmation until after primary signal 2026-01-12 19:06:03 +00:00