MQL5 Economic Calendar in backtesting

 

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!

News Einblenden
News Einblenden
  • 2019.08.01
  • amando
  • www.mql5.com
Hallo, nachdem es ja jetzt den News Array gibt von MQL, hat hier schon jemand was Programmiert damit im Chart eine Linie gezeichnet wird...
 

I've never used it myself, but maybe this can help.

Code Base

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.