Skip to content
Rafal edited this page Jan 2, 2019 · 6 revisions

Windows

Requirements

The following applications are required to be installed on your Windows PC:

  • MetaTrader 4 platform - can be found on your broker website (e.g. XM).
  • Install 7-Zip or similar file archiver.

You need at least 5GB of free space on the drive.

Manual method

Here are the steps to perform backtesting of the EA in MetaTrader 4 on Windows:

  1. In order to download backtest dataset files, go to https://github.com/FX-Data, select historical data from the list for a symbol (such as FX-Data-EURUSD-DS).

  2. On the repo page, click on the releases tab and choose the year or period (e.g. 2017).

  3. Download all HST files (ending with hst.gz) from the list (consisting OHLC data for each timeframe indicated by minutes).

    Note: You can hold Control key and click each file ending with hst.gz, or use Linkclump Chrome extension for easier multiple selection of the files.

  4. Download at least one FXT file (ending with fxt.gz) consisting tick data from the list. Ideally associated with the timeframe which you're going to use for testing. If you're not sure, choose XXXYYY1_0.fxt.gz, as it's going to be converted automatically for the right timeframe by the platform.

  5. If you downloaded all of the files for the given period, it's still fine.

  6. When finished, open containing folder with the files.

  7. Extract all files (with .gz extension). E.g. by selecting them, then selecting 7-Zip menu (or similar tool) from the context menu (right click of the mouse) and choose Extract Here. This will extract .gz files into files with .hst and .fxt extension, so .gz files won't be needed anymore.

    Note: If 7-Zip is not present, make sure you install it first (check Requirements section).

  8. Locate and open the platform data folder. For example by running the MetaTrader terminal or MetaEditor and select from the application menu: File, Open Data Folder (leave the folder window open). Then quit the platform in order to avoid altering any existing files while moving them (especially when connected to the broker).

  9. Now move all previously extracted HST files (.hst) to the history/default folder (replace/remove any existing files if required).

    Note: For easier selection, you may sort by Type. If you've multiple profiles setup in your platform, use your profile name instead of default.

  10. Using the same way, move all previously extracted FXT file(s) to the tester/history folder (e.g. Cut and Paste).

    Note: You don't need to set your file in read-only, but in case your tick or timeframe data files gets polluted with your broker data while platform running and it's online, you may need to replace the file(s) again.

  11. Run the MetaTrader platform and Open Offline chart from File menu to verify the existence and correct period of your tick data. You can also check where the data is stored (which file) when you hover your mouse pointer on the row.

    When the period is not correct (wrong file or got corrupted), you need to delete the existing FXT file(s) from the tester/history folder and copy/move/extract the file(s) again.

  12. Open Strategy Tester from the View menu (Control+R).

  13. Configure the settings as suggested below and hit Start.

    • Select EA and Symbol (according to downloaded files such as EURUSD). Set Model to Every tick.
    • Use date according to the downloaded period (or shorter).
    • Suggested Period is M15 or M30, but any other should work exactly the same way.
    • For Spread, ideally, use between 10 and 20 points (don't use Current).
    • For Expert properties use the default one unless you want to adjust or optimize it.
  14. While running, check the progress by changing the tabs (Results, Graph or Journal for a log).

  15. When finish, check the Report tab for the results.

  16. In case of any issues, check for any errors in the log file (Journal tab).

  17. If you need any help or guidance, raise a new issue, or ask at @EA31337.

Clone this wiki locally