How the Tester Acquires Historical Data
The Strategy Tester synchronizes and downloads the history of the main testing symbol from the trade server before starting the testing process. During the first run, the platform downloads all available history data of that symbol and does not request it again later; only new data are downloaded subsequently. A testing agent receives the history of the main symbol from the trading platform right after the start of testing. If data of other instruments are used during testing, the testing agent requests the required history from the trading platform during the first call of such data. If historical data are available in the platform, they are immediately transferred to the testing agent; if not, the platform requests and downloads them from the server and then passes them to the testing agent.
Additional trading history download can also be started when calling certain functions from an MQL5 application. The documentation provides a table that separates functions into those that trigger history download and those that do not. Before testing a multi-currency strategy, it is recommended to download all the necessary historical data to the trading platform to avoid delays in testing or optimization associated with download of the required data. The testing agents receive the history data from the platform in a compressed form, and during a re-testing the tester does not download data from the platform because it has data from the previous tester run.
Sources: MetaTrader 5 documentation: features
SymbolInfoDouble and SymbolInfoInteger Parameters That Trigger Downloads
When calling SymbolInfoDouble with specific parameters, the Strategy Tester initiates a history download for the requested symbol if the data are not already present in the platform. The parameters that trigger this behavior are SYMBOL_BID, SYMBOL_BIDHIGH, SYMBOL_BIDLOW, SYMBOL_ASK, SYMBOL_ASKHIGH, SYMBOL_ASKLOW, SYMBOL_LAST, SYMBOL_LASTHIGH, SYMBOL_LASTLOW, SYMBOL_TRADE_TICK_VALUE, SYMBOL_TRADE_TICK_VALUE_PROFIT, and SYMBOL_TRADE_TICK_VALUE_LOSS. Using SymbolInfoDouble with any other parameters not listed here does not cause a history download.
Similarly, SymbolInfoInteger triggers a history download when called with the parameters SYMBOL_VOLUME, SYMBOL_VOLUMEHIGH, SYMBOL_VOLUMELOW, SYMBOL_TIME, and SYMBOL_SPREAD. Calls to SymbolInfoInteger with other parameters not specified in this list do not initiate a download. This distinction allows developers to understand which property queries will pause a multi-currency test to fetch missing data and which will operate on already-cached information.
Sources: MetaTrader 5 documentation: features
SymbolInfoTick and SymbolInfoString Calls
Calling SymbolInfoTick for a symbol that is not the main testing symbol causes the Strategy Tester to request that symbol's history from the trading platform during the first call. If the data are not available locally, the platform downloads them from the server before passing them to the testing agent. This function retrieves the latest tick information, so the tester must ensure the underlying history is present to generate the current tick state.
SymbolInfoString also triggers a history download when invoked for a symbol whose data have not yet been synchronized. The function obtains string properties such as the symbol name, description, or currency, and the tester treats the first call as a signal that the symbol's history is required. Once the history is downloaded and cached, subsequent calls to SymbolInfoString for the same symbol do not cause additional downloads.
Sources: MetaTrader 5 documentation: features
SymbolName, SymbolSelect, and Margin Rate Functions
The SymbolName function triggers a history download when it is called to retrieve the name of a symbol at a given index in the Market Watch list. If the symbol's history is not already present in the platform, the tester requests it from the server during that first call. This behavior ensures that any symbol referenced by index has its data available for the test.
SymbolSelect initiates a history download when it is used to add a symbol to the Market Watch or to select it for use in the tester. The first selection of a symbol that lacks local history causes the platform to fetch the missing data. SymbolInfoMarginRate likewise triggers a download when queried for a symbol whose margin rate information depends on historical price data that have not yet been synchronized.
Sources: MetaTrader 5 documentation: features
Session Functions and Multi-Currency Test Preparation
SymbolInfoSessionQuote and SymbolInfoSessionTrade both trigger history downloads when called for a symbol that has not yet been synchronized. These functions retrieve the quote and trade session schedules for the symbol, and the tester treats the first call as a request for the symbol's history. The download occurs before the session data can be returned, pausing the test if the data must be fetched from the server.
During multi-currency testing, the tester automatically downloads the history of required symbols from the trading platform during the first call of the symbol data. The testing agent downloads only the missing history data and a little more to provide the required data for indicator calculation at the beginning of testing. For timeframes D1 and below, the minimum volume of downloaded history is one year; for weekly timeframes, about two years; and for monthly timeframes, eight years. If the required bars are not available, the starting date of testing is automatically shifted to provide the necessary amount of bars.
Sources: MetaTrader 5 documentation: features MetaTrader 5 documentation: testing
AI-assisted educational article. Automated checks reviewed source support and quality; they do not guarantee accuracy. This is not investment advice. Leveraged and automated trading involves substantial risk of loss.
Sources & further reading
MetaTrader 5 documentation: testingMetaTrader 5 documentation: featuresEducational content only. This article is not investment advice. Automated and leveraged trading involves substantial risk of loss.