Vetis wrote: Sat Sep 12, 2026 1:22 am So, I played around with the Xard indis to reduce its load on the platform, and I tried to optimize certain elements during startup so that not everything would launch at once .
I hope I didn't break anything else. The news reader might take a little while to load the information for some symbols now if you have a lot of tabs open, but within a minute, I think all the symbols should be synced.
When closing the platform, please be patient if you have a lot of tabs I think it will close no later than 5 seconds after you press the button.
list of changes
1. Heikin-Ashi Indicator (XU_HA_Candles+EMA_Ribbon)
Rebuilt the OnCalculate Loop: Replaced the broken incremental update logic with a standard rates_total - prev_calculated loop to properly handle full history backfills and live ticks without skipping.
Fixed CopyBuffer Series Conflict: Toggled the ArraySetAsSeries flag to false right before calling CopyBuffer, then back to true immediately after. This aligns the data chronologically and eliminates the massive, distorted wicks.
Added MA Null Safeguards: Implemented explicit 0.0 checks (ema4Val != 0.0) in ProcessBar. If the moving averages haven't loaded yet, the indicator falls back to a standard price-anchored Heikin-Ashi close rather than drawing a wick down to absolute zero.
Cleaned Buffer Indexing: Removed static series assignments for tempEMA arrays in the initialization block, shifting their management directly into OnCalculate.
2. Semaphore Indicator (XU SEMAPHORE)
Lowered Global Lookback: Reduced MaxBarsToCheck from 15,000 to 2,500 bars to prevent the script from choking the MT5 symbol thread and freezing the terminal on startup.
Optimized Memory Clearing: Stripped out a slow, manual for loop inside ZigZag_Calc and replaced it with MT5's native ArrayInitialize() for instantaneous array resets during recalculations.
Throttled MTF Data Retries: Increased the MTF missing-data retry delay from 2 seconds to 5 seconds (now - lastRetry >= 5). This stops the script from spamming CopyHigh/CopyLow requests, giving the terminal time to download background M15, H1, and H4 history.
3. News Reader (XU NewsTicker)
Removed Blocking Code from Startup: Moved the heavy CalendarValueHistory() request entirely out of OnInit(). This stops the indicator from freezing the chart while it waits for the broker's economic database to download.
Added UI Placeholder: Set the default startup text to [ SYNCING NEWS... ] so the chart UI loads instantly while the calendar syncs in the background.
Implemented an Adaptive Timer: Built a dual-state timer loop that polls gently during the initial startup, then automatically relaxes to a lightweight 60-second loop once the calendar data populates.
Adjusted Y-Axis Spacing: Increased InpYDistance from 130 to 165 to prevent the ticker text from overlapping with the Semaphore Bias Boxes.
Patched the "Zero Events" Bug: Changed the calendar array check to accept 0 events as a successful sync (count >= 0). This prevents the ticker from staying permanently stuck on "SYNCING" during weekends or bank holidays.
4. Dashboard (XU Dash 2)
Implemented Nuclear Ghostbuster Sweep: Overhauled the OnDeinit teardown sequence to completely eliminate "ghost" objects when the indicator is removed or the template is changed.
Explicit Deletion: Added precise deletion commands for every single known object by its exact string name.
Deep Chart Scan: Added a backward-iterating loop that scans every object on the chart and forcefully deletes anything containing the "dash_" prefix, catching any orphaned elements.
Forced Visual Repaint: Appended ChartRedraw(0) to the end of the de-initialization sequence to ensure the MT5 canvas immediately wipes clean without waiting for the next price tick.
XU_v057.zip
Excellent contribution, as always providing useful solutions to the strategy
I'm going to ask if you could add Windows Zones to the new, improved version (the boxes that show where the next traffic light will activate). You already did this for another version: XU SEMAPHORE - X - LOOKBACK (published on July 8th in post #2048). I've attached the file so you don't have to search for it, and a guide image of the input parameters.
If you can do this, I would be very grateful.