miroir de
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synchronisé 2026-04-11 04:30:56 +00:00
💡 What: Implemented a caching mechanism for the multi-timeframe (MTF) trend direction in the `GetMTFDir()` function. The trend is now recalculated only when a new bar forms on the lower timeframe. 🎯 Why: The `GetMTFDir()` function was being called on every new bar of the main signal timeframe, leading to expensive and unnecessary `CopyBuffer` calls. Caching the result prevents these redundant calculations, improving the Expert Advisor's overall performance. 📊 Impact: This change significantly reduces the number of expensive `CopyBuffer` calls, especially when the signal timeframe is much shorter than the confirmation timeframe (e.g., M5 signal, H1 confirmation). This leads to a more efficient EA that consumes fewer CPU cycles. 🔬 Measurement: The improvement can be verified by adding logging to the `GetMTFDir()` function and observing that the recalculation logic is only triggered once per bar on the lower timeframe, rather than on every signal timeframe bar. |
||
|---|---|---|
| .. | ||
| Experts | ||
| Indicators | ||