Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Libraries | HistoryLoader

MetaTrader Experts, Indicators, Scripts and Libraries

Real author:

MetaQuotes

https://www.mql5.com/en/docs/series/timeseries_access 

This functional module allows to upload historical data according to a request from a multi-currency Expert Advisor.

If only one chart is open in a client terminal with a functioning multi-currency Expert Advisor, the data for this chart only will be available for this Expert Advisor. The module is designed to solve this issue.

Place the HistoryLoader.mqh file to the terminal_data_folder\MQL5\Include. Then the command for inclusion of this file into the Expert Advisor's code must be added at the global level:

//+------------------------------------------------------------------+
//| Functions description for uploading history                      | 
//+------------------------------------------------------------------+
#include <HistoryLoader.mqh>

And now necessary LoadHistory() function calls must be made before the Expert Advisor code in the OnTick() function body:

int LoadHistory(datetime StartDate,            // starting date for uploading history
                  string LoadedSymbol,         // requested historical data symbol
                  ENUM_TIMEFRAMES LoadedPeriod) // requested historical data timeframe
449

Best MetaTrader Indicators + Profitable Expert Advisors