Exporting Data From MetaTrader

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.

About the author

Mark - Is a 28 year old form Australia. He has a Bachelor in Economics and a Major in CS. He is currently working towards his CFP. His interests include algorithmic trading systems, artificial intelligence, game theory and poker.

Do you have something to say?

Your email is never published nor shared.
Required fields are marked *