In this article I will present a simple method of testing expert advisors on offline charts (e.g. Renko, Range Bar) on MetaTrader 4 platform. At first, we need a script, that genertes an offline chart. On the Internet there are many such scripts. They can be found for example under the following links:
When you put a a script on a standard chart it generates the offline chart. However, this offline chart cannot be used on a strategy tester. To change this, we need to replace some history files, so that the data of standard chart (e.g. EURUSD M5) is changed by the data of generated offline chart. Of course, we do not want to lose a possibility to test expert advisors on a standard chart, so we will create a special server dedicated for testing expert advisors on offline charts. For this purpose:
- Open MetaTrader 4 folder (File->Open Containing Folder), go to Folder History and create new folder e.g. Offline.
- Copy the following files from the folder broker_name_demo to folder Offline:
- one minute history files, for example EURUSD1.hst, GBPUSD1.hst, USDCHF1.hst, EURPLN1.hst
- Change login account (File-> Login to Trade Account). Write Offline as a server name (at this moment we will lose a connection to the server).
- Reset the MetaTrader 4 platform. Only one minute charts, copied in the second step, will be available
- Put a Renko/Range script on a one minute chart. In the parameters tab, define a period of new chart, so that this is a standard timeframe (e.g. EURUSD5).
- Run the strategy tester and test the expert advisor.