Are there now possibilities for the Strategy Tester to include past news events?

 

Hello everyone,

I am currently working intensively on developing Expert Advisors and keep encountering a major issue: The Strategy Tester does not seem to take past news events into account. This results in backtests that do not reflect real market conditions, especially for strategies that are heavily influenced by volatility and news events.

Before writing this post, I conducted extensive research and came across the following thread in the German forum: News Einblenden

However, the thread is already 5 years old (from 2019), and I am wondering if there are now any new possibilities or workarounds to include news events in the Strategy Tester. Perhaps MetaQuotes has provided an official solution, or there is an efficient library that addresses this gap.

My questions to the community:

  1. Is there now a way for the Strategy Tester to automatically save and account for past news events?
  2. If not, what workarounds do you use? (e.g., external data sources, APIs, or manually integrating news events into the EA)
  3. Are there alternative approaches to achieving more realistic results for strategies where news events play a critical role?

I would greatly appreciate your experiences, tips, or links to relevant resources. It would be fantastic to find a method to make backtests as realistic as possible – especially for strategies that depend on news.

Thank you in advance for your support!
Best regards,
Mustafa Seyyid Sahin

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...
[Deleted]  
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
[Deleted]  

Please run a search. There have been several topics on the use of MQL5 economic calendar in the Strategy Tester.

There is also a mention in the MQL5 book: MQL5 Book: Advanced language tools / Economic calendar / Transferring calendar database to tester

MQL5 Book: Advanced language tools / Economic calendar / Transferring calendar database to tester
MQL5 Book: Advanced language tools / Economic calendar / Transferring calendar database to tester
  • www.mql5.com
The calendar is available for MQL programs only online, and therefore testing news trading strategies poses some difficulties. One of the solutions...
[Deleted]  

Also review the following by the author of the MQL5 book ...

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.

EDIT: And review the author's blog post too:

Backtesting news trading based on economic calendar history with adjusted timings
Backtesting news trading based on economic calendar history with adjusted timings
  • www.mql5.com
This blogpost presents some further results of experiments with news trading based on the built-in calendar of MetaTrader 5 and MQL5. Originally, the idea was implemented in the algotrading book as a
 
Fernando Carreiro #: Please run a search. There have been several topics on the use of MQL5 economic calendar in the Strategy Tester.

There is also a mention in the MQL5 book: MQL5 Book: Advanced language tools / Economic calendar / Transferring calendar database to tester

Thanks for the info

 
Fernando Carreiro #:

Also review the following by the author of the MQL5 book ...

EDIT: And review the author's blog post too:

This is extremely helpful, thank you for this information!

 
Mustafa Seyyid Sahin:

Hello everyone,

I am currently working intensively on developing Expert Advisors and keep encountering a major issue: The Strategy Tester does not seem to take past news events into account. This results in backtests that do not reflect real market conditions, especially for strategies that are heavily influenced by volatility and news events.

Before writing this post, I conducted extensive research and came across the following thread in the German forum: News Einblenden

However, the thread is already 5 years old (from 2019), and I am wondering if there are now any new possibilities or workarounds to include news events in the Strategy Tester. Perhaps MetaQuotes has provided an official solution, or there is an efficient library that addresses this gap.

My questions to the community:

  1. Is there now a way for the Strategy Tester to automatically save and account for past news events?
  2. If not, what workarounds do you use? (e.g., external data sources, APIs, or manually integrating news events into the EA)
  3. Are there alternative approaches to achieving more realistic results for strategies where news events play a critical role?

I would greatly appreciate your experiences, tips, or links to relevant resources. It would be fantastic to find a method to make backtests as realistic as possible – especially for strategies that depend on news.

Thank you in advance for your support!
Best regards,
Mustafa Seyyid Sahin

Yes, it is possible. I have done this by saving the news events into a file using MqlCalendarValue. You can now read the file in backtest