Discussing the article: "A Symbol Metadata and Trading Hours Cache in MQL5: Eliminating Redundant SymbolInfo Calls in Multi-Symbol EAs"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: A Symbol Metadata and Trading Hours Cache in MQL5: Eliminating Redundant SymbolInfo Calls in Multi-Symbol EAs.
This article presents CSymbolMetaCache, an MQL5 layer that preloads contract specifications and trading-session schedules for monitored symbols at EA startup and then serves typed getters from memory. It explains which properties are safe to cache versus dynamic ones, including the semi-dynamic tick value on cross-currency pairs, and implements an in-memory IsMarketOpen() evaluator. A benchmark quantifies latency reduction across a set of twenty symbols.
A multi-symbol EA monitoring twenty instruments typically calls SymbolInfoDouble(), SymbolInfoInteger(), and related functions on every tick for every symbol it tracks. Point value, tick value, lot step, and digits are the minimum set most position-sizing and price-formatting logic needs. At ten ticks per second across twenty symbols, with four such calls per symbol per tick, that is eight hundred terminal lookups every second.
These calls are not free. Each one crosses from EA code into the terminal's internal data structures, performs a lookup, and returns a value. For a fixed-contract instrument, point value, tick size, lot step, and contract size do not change between ticks or between bars. Re-reading static configuration eight hundred times a second, when it could have been read once at startup and held in memory, is overhead with no corresponding benefit.
At low symbol counts and tick rates this overhead is invisible. As either dimension grows, the cumulative cost becomes a measurable fraction of total tick-processing time, competing directly with the EA's actual signal computation.
What is missing is a layer between the EA's per-tick logic and the terminal's SymbolInfo API: something that fetches each monitored symbol's static contract specification and session schedule exactly once, holds it in memory, and serves every subsequent read from that memory rather than from the terminal. This article builds that layer.
The result is a CSymbolMetaCache class with typed getters for every cached field, an IsMarketOpen() method that evaluates trading session windows as a pure in-memory comparison, and a Refresh() method that is the only point after initialization where the cache touches the terminal API again. A benchmark script measures the actual latency difference across a twenty-symbol universe to quantify what caching delivers in practice.
Author: Ushana Kevin Iorkumbul