MyFxBots
Published on Wed Oct 16th, 2013

If you came here, you should have already downloaded your tick data either for free as mentioned in the Free Tick Data page from your own private source and now you are trying to use it in Metatrader 4.

Converting tick data file format

Native CSV file containing tick data are incompatible with Metatrader 4, so it can't be used in backtesting. FXT is the proprietary file format that contains ticks and can be read by Metatrader 4, so simply we need to convert CSV files to FXT. There is a script able to convert data from mostly any source to an FXT, it's available in the Downloads area here. HST files can also be used by Metatrader 4 when calculating the indicators, so HST files matching the FXT file are required for accurate tick data backtesting.

CSV2FXT binaries is what you need for the conversion process, it's available in the tick data downloads area too. It has been compiled with MT4 build 225 to widen its working range on MT4 builds.

Finally, here's a short guide explaining how to convert the tick data CVS file to an FXT file and a series of HST files:

  • First, if you still don't have CSV2FXT binaries archive, navigate to the tick data downloads area to download it.
  • Extract the files from the zip archive to the MT4 installation folder. A directory structure is inside, be certain that they are placed in the proper directories (CSV2FXT.mq4 and CSV2FXT.ex4 must be in experts\scripts, FXTHeader.mqh must be in experts\include, CsvReader.dll must be in experts\libraries). Be certain too to copy them to the correct folder if there are multiple MT4 installations.
  • Move the CSV tick data file to experts\files in the same MT4 installation folder.
  • Open a chart for the pair that you have data for (e.g. EURUSD chart for EURUSD.csv file).
  • Select the timeframe that you want to create the FXT for. For instance, if you want to backtest on M1, you should select M1 timeframe for the chart, while the FXT file created for a certain timeframe won't work for other timeframes; for backtesting on another timeframe you simply have to create a new FXT.
  • Be sure now that your terminal is connected to the broker before proceeding (at the lower right corner, if it is “not connected” you have to fix that first).
  • Be sure too that DLL calls are allowed. You can do that by opening the Tools menu, select Options, select Expert Advisors then ensure that Allow DLL imports is enabled while Confirm DLL function calls is disabled.
  • Double click the CSV2FXT script in the navigation panel, it's available in the scripts area.
  • A pop up window will open, configure the parameters there.
    • CSV2FXT_version: it's a parameter that just quickly indicates what version has been installed. There is no effect of changing it.
    • CsvFile: it can be left blank if the name of the file is just like the symbol and with a CSV extension (e.g. EURUSD.csv); if not, just type the file name.
    • CreateHst: for HST files to be created for backtesting, this setting have to be true. If set to false, as you may have already generated HST files and you just need to generate an FXT for a different timeframe. Whenever you changed the GMT or DST, you have to create new HST files.
      This setting if enabled will lead to HST files formation for the whole timespan of the tick data file regardless of the time range selected.
    • Spread: this is the fixed spread of the resulting FXT file, expressed in pips; 2.3 will result in a 2.3 pips spread. Its default value is 0.0, letting it so will make the converter use the current spread of your broker. You should care about the fact that many brokers are widening their spreads during the weekends.
      If you plan to use real spread; the variable spread in the CSV file, you can then leave this parameter set to its default.
    • StartDate and EndDate: these settings determine the FXT file time span. The StartDate and EndDate format is YYYY.MM.DD. If you want the converter to use the CSV file earliest and latest date available respectively, just leave these fields blank.
    • UseRealSpread: as the name indicates, this parameter if enabled will make use of the CSV file real (variable) spread in the resulting FXT.
      By using the loader script, it'll be a must to enable real spread to be able to use such FXT files. The Tick Data Suite can detect automatically if the real spread is used by FXT file, so you don't need to pay attention to this part if you used it.
    • SpreadPadding: this setting is to pad real spread - if being used - by a certain pips count; if you want to pad it by 0.8 pips, just add 0.8 here.
    • PipsCommission: if you want your resulting FXT file to include a commission, the desired value can be set here. The figure is a back and forth and is expressed in pips.
    • MoneyCommission: it's set the commission expressed in money as an alternative to be in pips. The value is expressed in base account currency per lot.
    • Leverage: changes the FXT file leverage.
    • FXTGMTOffset: to set the FXT GMT offset to other than 0.
    • CSVGMTOffset: the CSV file data GMT offset. The conversion script can detect automatically several free tick data providers formats and apply the correct setting here, so it could be safe to leave it set to “autodetect”. If the experts log revealed a message that the script is unable to identify the tick data source, you will need to manually set the CSV GMT offset here.
    • FXTDST: the FXT file DST setting. 0 means no DST, 1 means US DST, 2 means European DST. Be aware that the DST is calculated if the US DST setting is set, according to the regulations that were applied by the start of 2007.
    • CSVDST: the CVS file DST setting. it's safes to leave it to “autodetect”, or you can do the same as for the FXTDST.
    • TimeShift: This parameter if enabled, will shift all the created data 28 years backwards. This can be done if you suspect an EAs to have hardcoded days aiming to backtesting cheating. It's determined by 28 year shift as the calendar is identical when dealing with the days of the week and leap years. This may be unfair to judge an EA using this method, as some EAs may have legal causes to dissimilar result by backtested with a shifted time.
    • CreateM1, CreateM5, CreateM15, CreateM30, CreateH1, CreateH4, CreateD1, CreateW1, CreateMN: These parameters aim to allow the creation of multiple FXT files in a single run. By default, the script will create the FXT for the timeframe of the already running chart, no matter if that specific timeframe parameter is enabled or not. You don't need enable these parameters unless you really need the FXT for a different timeframe.
  • Click "Ok". Once done, the data creation process will be launched, typically taking 20 to 45 minutes, depending on the data range and volume, could be even more if a slow machine is being used. A progress indicator will be in the chart upper left side and by finishing, an alert will come out. Throughout the conversion, some data will be printed in the experts log for any problem that could occur.

Once every thing is done and the script finishes processing, you will be prompted to determine if the files will be move to their proper locations. If Yes is selected, restart Metatrader 4 terminal to be certain that the HST files are well synchronized, then directly proceed following the next guide; Using the tick data in your backtests. If No is selected, you there will be an FXT file and a pack of HST files in experts\files folder and before using them, you need first copy and paste them in the correct location, then go on following these steps:

  • Exit the Metatrader 4 terminal.
  • Move all the .HST files from experts\files to history\[your_server_name].
    Be very aware of the number server directories in the history folder, the .HST files have to be in the correct one for active account.
  • Move the created FXT file from experts\files to tester\history.

Now, it's all done with the conversion and setup. It's time now to proceed to backtesting, but take in consideration that it isn't as easy as clicking Start in the backtesting user interface. Some additional tools which are described in the Using the tick data in your backtests part, may be called for help.

If faced any problem, please navigate to the FAQs and Troubleshooting page.

Latest Tick Data Suite News and Updates

Current MetaTrader Platform Will Stop Working After May 1st, 2023 The traders using a version of MT4 older than build 1370 on Windows, their MetaTrader platform will stop working after May 1st, 2023. You should update your MT4 to the latest free version to ensure a seamless and uninterrupted trading experience. The latest MT4 build features improved platform stability and you can download it by following the instructions below:
MetaTrader 4 and 5 Applications Are Back in the Apple AppStore MetaTrader 4 and MetaTrader 5 Apps were reinstated on March 6th, 2023, and are now available on the AppStore. MetaQuotes has communicated with Apple regarding operational technicalities throughout the lengthy process of restoring the Apps back to the AppStore, providing further insights as needed.
MT4 and MT5 have been removed from Apple iOS AppStore Apple removes the widely used and most popular Forex Trading Apps; MetaTrader MT4 & MT5 from App Store MT4 & MT5 apps are no longer on the App Store globally.
Renko Bar Backtesting with Tick Data Suite and Other Great Features It is now possible to run backtests using Renko bars natively. This was previously possible only with the assistance of 3rd party software through a cumbersome process with a somewhat unfriendly learning curve; now it is available directly in the Tick Data Suite
Tick Data Suite Features and Details The Tick Data Suite is a Unique Product with which you can Download Tick Data, Do Backtesting and Optimization your Strategies using Variable Spread in Metatrader 4
Free Tick Data Download A lot of tick data sources are available online and this is an attempt to cover some of the most well and popular providers where tick data are free to download
Tick Data Suite Guide [OUTDATED] On arriving to this guide, it's assumed that you already downloaded the desired tick data and it was converted to an FXT file and several HST files, each of which is setting in its proper place. If the steps above were not done yet, you will need first to follow the How to download free tick data and the How to prepare the tick data for MetaTrader 4 guides
How to Download Dukascopy Tick Data and Purse it with Birt's PHP Scripts [Outdated] A Brief Guide On How To Download And Process The Free Forex Tick Data From Dukascopy Using Birt's PHP Scripts. The Available Data In Dukascopy Is Raw In The Form Of Files Spanning Only One Hour, So It's Obvious That Tools Will Be Needed To Download And Parse It
How to Download Dukascopy Tick Data with JForex Platform A Quick Guide on How to Download and Process the Free Forex Tick Data from Dukascopy using the JForex Platform
Download Birt's Free Tick Data Tools and Scripts [Outdated] Download Birt's Free Tool and Script Files Helping you to Acquire, Process and Use Free Tick Data in Metatrader 4 Backtesting
Problems with Conversion to FXT and Tick Data Usage in Tick Data Suite [Outdated] Problems and Issues with Strategy Backtesting in Metatrader 4 Using Tick Data Suite, from CVS Conversion to FXT to Tick Data Usage
Free Birt's Batch Script MT4 FXT Files 2GB Limit Removal [Outdated] Birt's Patch Script Removes the 2GB the Metatrader 4 Limitation with FXT Files and Disables Overwriting Existing FXT Files too, which Effectively Permits Pre-Created Tick Data FXT Files Usage.
Enabling and Verifying the Use of Prepared Tick Data by MT4 for Backtesting [OUTDATED] As the Latest Metatrader 4 Client Builds are Unable to use Custom FXT Files Anymore, a Special Software has to be Run to Enable it for that; Tick Data Suite, a Commercial (Paid) Software, or the Completely Free Birt's Patch Script with Some Limitations.
How to Prepare Tick Data FXT Files for MT4 Backtesting with CSV2FXT [OUTDATED] Native CSV File Containing Tick Data are Incompatible with Metatrader 4, so it Can't be Used in Backtesting. FXT is the Proprietary File Format that Contains Ticks and Can be Read by Metatrader 4, so Simply we Need to Convert CSV Files to FXT.
Tick Data Suite VS Free Birt's Batch [OUTDATED] In fact, the Tick Data Suite is a commercial alternative for the free Birt's patch script, so every fault or deficiency in the latter are addressed in the Tick Data Suite with full technical support to its clients

Talk about Tick Data Suite

Information, charts or examples contained in this review article are for illustration and educational purposes only. It should not be considered as an advice or endorsement to purchase or sell any security or financial instrument. We do not and cannot give any kind of financial advice. No employee or persons associated with us are registered or authorized to give financial advice. We do not trade on anyone's behalf, and we do not recommend any broker. On certain occasions, we have a material link to the product or service mentioned in the article. This may be in the form of compensation or remuneration.