mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 12:50:57 +00:00
This optimization refactors the `OnTick` function to lazy-load the Average True Range (ATR) value. Previously, the ATR was calculated via `CopyBuffer` on every potential trading signal, regardless of whether the user's Stop Loss or Take Profit settings required it. This created unnecessary overhead in a performance-critical function. This change introduces a new `GetATR()` helper function that only calculates and caches the ATR value when it's explicitly needed by the SL/TP logic. This avoids the expensive `CopyBuffer` call entirely for configurations that do not rely on ATR, improving the overall efficiency of the Expert Advisor. |
||
|---|---|---|
| .. | ||
| SMC_TrendBreakout_MTF_EA.mq5 | ||