Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

History Downloader - MetaTrader 4 Expert | Forex Indicator Download - MT4/MT5 Resource

author EAcpu | 3 reads | 0 comments |

The EA downloads the quote history for the current chart symbol and period by "Pressing the Home Button". The method is based on ideas implemented in s-Downloader from Talex scripts ( link to code base ).

The main difference from s-Downloader is that only the bar charts for the specified time within the current time range are downloaded. Personally I find this more convenient since I'm testing on a single TF (which I usually use).

In this implementation, the EA is executed on a single start() iteration. This creates some difficulties in getting the number of bars and the time of the first bar in the chart window. Therefore, the EA obtains these data from global variables updated using the History Downloader I indicator (see attachment). In fact, this indicator does nothing except updating global variables :)

Attachment contains EA ( HistoryDownloader.mq4 ), indicator ( HistoryDownloaderI.mq4 ) and an archive containing source code + compiled files ( HistoryDownloader.zip )

How to use it all:

Date Time to Date - Quote History Download Deadline

Integer pause - Chart update wait time in milliseconds. Default value is 1 second (1000)

Integer rows_max_failures - The maximum number of consecutive unsuccessful attempts to "move" the chart. The default value is 10

I've tried my best to comment the code in detail. After all, this is my first article in CodeBase.

Shows the relative strength of selected currencies on a chart.

Get entry signals from specific candles according to your rules.

This script downloads the history of all timeframes and symbols in Market Watch.

After backtesting, we usually need to analyze the test results on a new chart that loads the template. At this time, we need to copy the objects on the test chart to the new chart. This script helps to save the object to a file and display the object on a new chart.


Attachment download

📎 historydownloader.mq4 (20.35 KB)

📎 historydownloaderi.mq4 (4.14 KB)

Source: MQL5 #9153

Verification code Refresh