Skip to content
All library documents

Managing Multi-Timeframe Bar Series with a Symbol Timeseries Object

Article MQL5 articles

Summary

This installment in a software-library series explains how to organize bar data for multiple timeframes of one trading symbol. It builds on a prior single-symbol, single-timeframe bar collection and introduces a symbol-timeseries object that holds separate series for the periods a program needs. The library’s bar collections support searching and sorting bars by properties, updating current data, and detecting newly opened bars.

The implementation refactors shared program-type state into a base object and makes timeseries and new-bar classes inherit from it. The article then describes creating and initializing collections for a symbol’s available periods and using a test Expert Advisor to display loaded data and report new bars in the journal. The test output illustrates that the collections are populated and new-bar events are detected during a visual test. This is a programming architecture tutorial rather than a trading method; it covers one symbol’s timeframes, with a common collection for multiple symbols left for a later installment.

Key ideas

  • A symbol-timeseries object can group separate bar collections for multiple timeframes of one symbol.
  • Bar collections support searches and sorting by bar properties, along with current-data updates and new-bar detection.
  • A shared base class stores the running MQL program type for derived library objects.
  • The test EA loads series and reports new bars across configured timeframes during a visual test.
  • The installment handles one symbol, while a collection spanning multiple symbols is deferred.

Tags

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