Exporting Data From MetaTrader

April 6th, 2009
|

I received an email today from a reader wanting to know if there was an expert advisor available that would export data to a csv file. although I have not myself seen an EA that does this it is a trivial matter to code such an EA shown below:

int handlFile;
handlFile = FileOpen(“symbol.csv”, FILE_CSV | FILE_WRITE | FILE_READ, ‘,’);
FileSeek(handlFile, 0, SEEK_END);
FileWrite(handlFile, Bid, Ask, Close[1], Volume[1]);
FileClose(handlFile);

Note: This code above is intended as a very rough solution. Time permitting I will write a proper EA with error checking and better features. This code however should be sufficient for basic tasks. For more information on EA coding I strongly recommend you download the getting started book:

MQL Tutorial

The Non EA Export Option

Can’t be bothered with that coding garbage? Never fear there is a very simple option. Go to the Tools Menu then History Centre a dialog box similar to the one shown below will appear simply chose the currency you wish to export and select a file name and your done. This process is shown below:

ExportMetaTraderDataCSV

MetaTrader really is an excellent platform for learning the basics of trading and trading systems. I would recommend to anyone starting out in currency trading that they download MetaTrader and start exploring. If you want to learn more about Forex Trading I suggest you visit the Forex section of this website.

You may also like:

2011 The YearIn Charts
toolbarClock
eSignal11-detailedQuote

Leave a comment: