Designing Bar Objects and Searchable Symbol Time Series in DoEasy
Summary
This installment describes a MetaTrader library design for storing price history as bar objects and organizing those objects into a per-symbol, per-timeframe list. A bar object holds standard rate data such as timestamp, open, high, low, close, spread, and volume, alongside derived attributes including calendar fields, bar index, candle body, total range, and wick sizes. The article sets out typed properties and sorting criteria so programs can search, compare, and sort bars by these values.
The design follows an object collection pattern built around dynamically stored object pointers. A configurable history range determines how many bars the list retains, with a default of one thousand or the available history when shorter. The article walks through implementation and testing in the library, but its contribution is software infrastructure for handling market data rather than a trading signal or strategy. It does not present performance evidence or discuss how these bar attributes should be used to make trades.
Key ideas
- A bar object can combine raw OHLCV-style data with calendar and candle-shape attributes.
- A per-symbol and timeframe collection makes bar data available for searching, comparison, and sorting.
- Typed properties and sorting modes provide a consistent interface for accessing stored bar fields.
- The retained history range is configurable and defaults to one thousand bars.
- The article explains data-management infrastructure rather than a tested trading method.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.