Random Stuff

MetaTrader History ToolKit
My ATC2012 EA
Heinz Engine
Honda Steed Exhaust Mod
3DS Retro Game Gallery 
Frypan-Lamp Biquad Antenna
HTPC 001
Aerospace AL CPU Cooler
PHP Pager
Developer's Notes

MetaTrader History ToolKit


Should I use a DDE Server or this toolkit to work with rates?

It all depends on what you want to do and how you want to do it: DDE Servers are fantastic for real-time live-tick data. If you’re making an application/analysis that requires the latest ticks or the most precise and minimal timeframe possible then DDE Servers are the way to go.

In the other hand, MetaTrader History Toolkit goes beyond the scope of a DDE Server by offering access to the underlying history file for input and output operations, allowing to manipulate history data for further use by other clients. Computing wise, MetaTrader History Toolkit offers a great solution for offline data processing such as Artificial Intelligence training, massive data calculations or arbitrary analysis of current and all available past data in M1 timeframe (or greater, but experimental). If you’re making an application that requires access to the physical history file or you are working with the logical data and need the best computing performance possible then this toolkit is the way to go.

Do I require MetaTrader to use this toolkit?

The toolkit does not require the MetaTrader terminal to be running, in fact, it is recommended to close the terminal to avoid I/O conflicts.

Hopefully you will not need this toolkit at all. MetaTrader is a powerful platform that provides all the tools needed to do whatever you want. There’re however these cases where you need to work with rates data outside the client terminal, that’s probably why you’re reading this.

Where can I find my history files?

The easiest way to find your history files is:

  1. Open MetaEditor (included in the MetaTrader installation).
  2. In the Navigator workspace (Ctrl + D) right click the first item MQL5.
  3. Now in the context menu select the option Open Folder.
  4. A window will pop-up with a bunch of folders in it. Please jump a single folder back from where it originally was.
  5. You should now encounter a few folders. One of them is called bases, please open that folder.
  6. You should now see a folder named with your broker's name or similar. Please open that folder.
  7. Now open the folder named history.
  8. At this point you'll find a couple of folders named as all the symbols supported by your broker, open the folder whose symbol you wish to work with. If the symbol you want is not listed then try creating a new chart for this symbol in the MetaTrader client terminal, this should create the needed folder, files and fetch the latest rates.
  9. You're now done! You should now see all files for the associated symbol separated by year. These are the files you need to work with.

My history files seem to be incomplete, what's going on?

MetaTrader works in a fetch-by-read basis getting from server only the rates you have visualized in your charts. To download all the rates from the server you should (while connected to the internet):

  1. Open the Strategy Tester (Ctrl + R) in the MetaTrader client terminal.
  2. In the Strategy Tester workspace select any Expert Advisor to test (any preinstalled EA should work just fine).
  3. Select of course the symbol whose history file you need to fix. Any timeframe will do.
  4. As the Date field simply select Entire history.
  5. Now hit the Start button and that's it. Wait for MetaTrader to finish the test. By the end of it your history file should now be complete.

Can I use this toolkit to modify history data?

Yes, since version

Can I use this toolkit to create my own custom HCC file?

No, you can not create an HCC file from scratch using this toolkit. You also can not add/insert/remove rates to/from an existing HCC file using this toolkit. I've got some ideas to make something like this to work but there is nothing concrete about it nor tests of the like. This is considered for future releases.