Looking to streamline your trading experience? The History Downloader EA is here to help! This handy tool downloads the quote history for the current chart symbol and timeframe with just a simple press of the Home button. It builds on the concept found in the s-Downloader from Talex script, which you can check out here.
What sets the History Downloader apart from the s-Downloader? It focuses exclusively on downloading bars from the current timeframe, up to a specified date. Personally, I find this approach much more convenient, especially since I usually run tests on a single timeframe.
The EA operates on a single start() iteration, which posed some challenges in retrieving the number of bars on the chart and identifying the time of the first bar. To overcome this, the EA pulls data from global variables that are updated through the HistoryDownloaderI indicator (included in the attachment). And just so you know, apart from updating these variables, the indicator doesn’t do much else! :)
In the download package, you’ll find the EA (HistoryDownloader.mq4), the indicator (HistoryDownloaderI.mq4), and an archive containing both source codes as well as compiled files (HistoryDownloader.zip).
How to get started:
- Press Ctrl + O to check the maximum bars available in history and on the chart;
- Open a chart for the symbol you need and select the timeframe for which you want to download history;
- Disable auto-scroll and zoom out to the minimum scale;
- Launch the HistoryDownloaderI indicator on the chart;
- Finally, run the EA.
EA Parameters Explained:
datetime ToDate - Specify the date up to which you want the quote history downloaded.
int Timeout - This parameter sets the waiting period for chart updates, measured in milliseconds. The default value is set to 1 second (1000).
int MaxFailsInARow - This is the maximum number of consecutive unsuccessful attempts to shift the chart. The default is set to 10.
I’ve put a lot of effort into commenting the code thoroughly, so you’ll have a clear understanding. This is my first publication in CodeBase, and I hope you find it useful!
Comments 0