Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
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
- www.mql5.com
Also review the following by the author of the MQL5 book ...
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:
- www.mql5.com
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
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:
- Is there now a way for the Strategy Tester to automatically save and account for past news events?
- If not, what workarounds do you use? (e.g., external data sources, APIs, or manually integrating news events into the EA)
- 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
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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:
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