Skip to content
All library documents

Speeding Up News Backtests with Daily Loads and Hourly Event Arrays

Article MQL5 articles

Summary

This article proposes two code-organization changes to speed up a news-trading Expert Advisor during backtesting. First, it recommends loading the in-memory calendar database’s required information for the current day, reducing repeated database access during that day. Second, it groups events into separate arrays by hour, so the program can select the relevant hourly collection when checking for events. The article also introduces enumerations and conversion functions for hours, minutes and seconds, plus classes for storing candle times and hourly event data.

The implementation is presented as groundwork for later articles, rather than as a completed trading strategy or a measured performance study. The text claims that reducing database lookups and narrowing event searches should improve runtime, especially on event-heavy days, but gives no benchmark results. It describes a fixed 30-second pre-event entry convention and mentions liquidity concerns around major announcements, though the supplied text omits the stated pros and cons and cuts off part of the explanation. The material is primarily about organizing time and event data for news-based systems.

Key ideas

  • Loading calendar data once for the current day can reduce repeated database access during backtests.
  • Grouping news events by hour lets the program inspect only the relevant hourly collection.
  • Enumerations and conversion functions provide named representations for time components.
  • The article sets a 30-second pre-event time as its proposed entry convention.
  • The described data structures are presented as building blocks for later implementation, with no runtime benchmarks supplied.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.