I've never used it myself, but maybe this can help.
Economic Calendar Monitor and Cache for Backtesting on History
Stanislav Korotky, 2024.11.10 19:33
This indicator displays current events on the chart and allows you to export the calendar to archives for backtesting, automatically fixing time discrepancies between the history of bars and the history of events. This is an improved version of CalendarMonitorCached indicator from the algotrading book.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The title says it all—I need to use the economic calendar for event handling during backtesting. However, as many of you know, the CalendarValueHistory function in MQL5 doesn't work during backtesting.
After researching, I came across this solution: https://www.mql5.com/de/forum/319172. While it seems promising, I'm struggling to understand how to retrieve past event data. The instructions mention running the script in debugging mode with live data to generate files containing calendar events. However, when I attempt this, the script only starts from the current date and captures ongoing events, without populating historical data.
Could someone clarify how to properly set this up or suggest an alternative way to obtain historical economic calendar data for backtesting purposes? Any help would be greatly appreciated!