mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-11 06:40:57 +00:00
This commit implements several performance optimizations in the SMC MTF indicator: 1. Robust Early Exit: Added a 'new bar' check using iTime() to skip redundant calculations on every price tick. Handled prev_calculated=0 to ensure full history recalculations when requested. 2. Lazy Loading: Wrapped expensive fractal and Donchian calculations in conditional blocks so they only execute if the respective features are enabled. 3. Efficient Buffer Clearing: Replaced manual O(N) loops with ArrayInitialize() for bulk clearing of indicator buffers on first run. 4. Robustness: Added 'history not ready' checks (iTime == 0) to both the indicator and EA. 5. Cleanup: Removed redundant ArraySetAsSeries calls on static arrays in GetMTFDir and updated comments. Impact: Reduces CPU usage on every tick by skipping unnecessary logic and improves initialization speed during history loading. Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| SMC_TrendBreakout_MTF.mq5 | ||