Here is the modified indicator, including the following changes:
1. Massive performance increase (CPU load reduction)
Problem: In the previous version, the entire news file (XML) was re-read and analyzed with every single price tick. This led to an enormous CPU load during periods of high market volatility and could slow down the terminal.
Solution: The news is now loaded into internal memory once at startup or during a targeted update (via timer). Ongoing operations access this prepared data at lightning speed without burdening the system.
2. Correction of the display logic (date & month)
Problem: The month display was incorrect. The current month was often displayed instead of the month in which the news event actually takes place.
Solution: The date function has been rewritten to calculate the correct date for each event individually. Future news at the turn of the month is now displayed correctly.
3. Intelligent news comparison (Coloring)
Problem: The comparison between forecast and previous values was based on text comparisons. This led to errors: For example, the indicator ābelievedā that ā2%ā was more than ā10%ā because the number ā2ā comes after ā1ā in the alphabet.
Solution: A new conversion logic converts the text values into real numbers. The color coding (positive/negative) now works mathematically correctly, even with percentages or different units.
4. Flicker-free visualization
Problem: Graphical objects were deleted and redrawn with every tick, which could lead to unsettling flickering on the chart.
Solution: The indicator now checks whether an object already exists and only updates the values. This conserves graphics resources and ensures a clean display.
5. Optimization for experts (EA interface)
Interface: The data buffers used for access by Expert Advisors (EAs) have been stabilized. EAs can now read the minutes until the next event and its strength (impact) more reliably via the iCustom function.
A quick note on operation:
If you drag the indicator onto the chart and see nothing, please check the following two things in your MetaTrader 5:
DLL imports: Make sure that under Tools -> Options -> Experts, the box next to āAllow DLL importsā is checked (as the indicator uses urlmon.dll for the download).
Web request: It doesn't hurt to add the URL https://nfs.faireconomy.media to the list of allowed URLs (Tools -> Options -> Experts -> Allow WebRequest for the following URL), although URLDownloadToFileW is technically a Windows function and often works without this entry.