How to backtest using tick data – the free Birt’s patch script

If you’re at this step, this should be rather straightforward. The script removes the 2GB limitation that Metatrader 4 has with FXT files and also disables overwriting existing FXT files, which effectively allows the usage of pre-created tick data FXT files.

This guide is split into two sections:

Using the Birt’s patch script

Before getting started with the script, it’s very important to know that there are some limitations and that there is no support available whatsoever. If you need technical support or if you want an easier experience, you should check out the Tick Data Suite. A free trial is available.

  1. If you are using MT4 build 405 or higher and you want the 2GB limitation removal feature, download and install the Microsoft Visual C++ 10 runtime available on the tick data downloads page in the Runtimes section.
  2. Download the latest version of the Birt’s patch script from the tick data downloads page.
  3. Install the script in your Metatrader 4 installation folder (Birt’s patch.mq4 should end up in experts\scripts)
  4. Open any chart you wish on any timeframe.
  5. Make sure that DLL calls are allowed. If you don’t know how to do that, you have to open the Tools menu, select Options, select Expert Advisors and ensure that Allow DLL imports is enabled while Confirm DLL function calls is disabled.
  6. Double click Birt’s patch in your navigator window in the scripts section.
  7. Configure the parameters as you want. The defaults are fine unless you have an FXT with real spread, in which case you must enable that parameter.
    Note: once real spread is enabled, your backtests will ONLY work with variable spread FXT files and if you want to perform a backtest with regular fixed spread you have to restart your MT4 terminal.
  8. Select the currency pair and timeframe that you created the FXT for.
  9. Start the backtest!

Known issues

Most of the issues described below do not apply to the Tick Data Suite.

  • You cannot run optimizations (trying to do so will result in a crash for builds 405+).
  • The script does not work with third party tools such as the Walk Forward Analyzer.
  • You must run the script manually every time you restart Metatrader 4.
  • The 2GB limitation removal is only available for Metatrader build 405 and up if you install the Microsoft Visual C++ runtime (download link available on the tick data downloads page). For previous builds, it is available only for select operating systems (Windows Vista, Windows 7, Windows Server 2008).
  • FXT files larger than 4GB will only be read up to 4GB.
  • Running a backtest before starting the script, proceeding with running the script and then starting another backtest will result in a crash.
  • You have to manually enable real spread and you have to restart the terminal if you no longer want to use real spread.
  • As stated above, there is no support. You have to make do with the older comments on the tick data page and with the troubleshooting section on the Tick data backtesting page.
  • #1 written by Harrison April 21, 2012 (4 years ago)

    Works a treat! Just a note:

    By some quirk of fate I have a testing installation of MT4 that is fixed at version 409 (it’s not connected to any broker, no account, and no LiveUpdate since I dont want them to overwrite HST files which I’ve downloaded from Metaquotes). So I used a demo install version to convert the tickdata, then copied it over to the test install and ran the final script.

    Thanks again!

  • #2 written by luca May 28, 2012 (4 years ago)

    Hi there great Birt
    I am brother of paolo from italy. We continue to appreciate your job and are happy you fund a commercial way to get paid from your precious job.

    I read all about the “new” CSV2FXT script.
    I usually used old JFOREX2FXT script.

    I have only one question:
    I made a comparison about fxt created with jforex2fxt and csv2fxt, starting from the same csv, with a mt4 build 402 (kept for this situation).

    Using then the EA called “data integrity checker” from, i see results are identical except the number of ticks.
    In details, for cross audnzd from 2009.10.1 to 2012.05.10 i got
    40mln ticks with jforex2fxt and 28mln ticks with csv2fxt.

    Is that difference caused by a better compression with csv2fxt script?
    I mean probably you retained to wipe out ticks doubled…

    thanks birt

    • #3 written by birt May 28, 2012 (4 years ago)

      The only difference is that the newer script eliminates duplicate consecutive ticks (same Bid & Ask price) that occur within the same minute, thus creating FXT files that are not so big in size and take a shorter time to backtest. Since you’re not the first to ask about it, the next CSV2FXT version will feature this as a parameter, enabled by default.

  • #4 written by luca May 28, 2012 (4 years ago)

    thank you for your helpful reply Birt.

  • #5 written by Laszlo Szollos June 30, 2012 (4 years ago)

    Hi everybody!

    My question is that,how can I setup a 409 version of MT4? Because every time I tried it automatically updated itself to the newest version(432).


    • #6 written by birt June 30, 2012 (4 years ago)

      You can rename (or delete) liveupdate.exe to avoid that. Best of luck!

  • #7 written by Laszlo Szollos July 1, 2012 (4 years ago)

    Thanks very much, it works, but now in the right down corner writen “Old version” and make now connection with the Broker.
    Have you any idea, what can I do?


    • #8 written by birt July 1, 2012 (4 years ago)

      You can only backtest using an existing FXT (which should be compatible regardless of the build it was generated with). Other than that, please note that the Birt’s patch script is no longer supported.

  • #9 written by Thiago July 31, 2012 (4 years ago)

    So to say that if I use the Walk Forward Analyzer along with Birt’s v0.21 patch script, the results will not be 99% quality? And if I use without Birt patch, the results also will not be with 99% quality?

    • #10 written by birt August 1, 2012 (4 years ago)

      The WFA simply doesn’t work with the free Birt’s patch script (or rather the other way around). It does work with the Tick Data Suite, though.

      If you use the WFA by itself, you can get up to 90% modeling quality (randomly interpolated M1 data).

  • #11 written by Carol August 13, 2012 (4 years ago)

    Hi Birt

    I m trying the birt’s patch v021 by following the steps you listed above and I got the below message when I attached the patch script to a 1M chart (platform is nor connected)

    2012.08.14 05:23:43 birt’s patch GBPUSD,M1 inputs: Version_0.21=”Works only up to MT4 build 409″; NoFXTOverwrite=true; Remove2GBLimit=true; WARNING2=”Using variable spread with a non-variable spread FXT does NOT work.”; RealSpread=true;
    2012.08.14 05:23:43 birt’s patch GBPUSD,M1: MT4 build 409 detected.
    2012.08.14 05:23:43 birt’s patch GBPUSD,M1: FXT overwriting disabled. Addresses patched: 0x556122, 0x55623B, 0x556343.
    2012.08.14 05:23:44 birt’s patch GBPUSD,M1: Patched: fseek 0x557244, fopen 0x557154, fclose 0x55710E, fclose 0x555BD5, fclose 0x5563EE, fread 0x55729A, filelength 0x55718D. 2gb limit removal patch was installed at 0x2430000.
    2012.08.14 05:23:45 birt’s patch GBPUSD,M1: Process patched for variable spread at 0x557016. Volume check removed at 0x55734E.
    2012.08.14 05:23:45 birt’s patch GBPUSD,M1: uninit reason 0
    2012.08.14 05:23:45 birt’s patch GBPUSD,M1: removed

    Afterthat I started the backtester to run the default MACD EA, the platform and the strategy tester just hanged there. What I did wrongly?

    • #12 written by birt August 14, 2012 (4 years ago)

      As previously mentioned, I’m afraid I am no longer offering support for the Birt’s patch script.

  • #13 written by Walt October 29, 2012 (4 years ago)

    When I tried to backtest with version 438 it says “testGenerator: internal error because the file not opened,” which I assume is due to the patch not working. Also, this one is not available anymore:

    “If you are using MT4 build 405 or higher and you want the 2GB limitation removal feature, download and install the Microsoft Visual C++ 10 runtime available on the tick data downloads page in the Runtimes section.”

  • #14 written by Walt October 29, 2012 (4 years ago)

    Ah, I found if I delete the fxt file in tester/history it works, thanks.

  • #15 written by ifad June 18, 2013 (3 years ago)

    Hi Birt,

    That’s very kind of you providing such a free script. However, today all metatrader from broker is build 500. Do you have idea where i can get build 409?

    • #16 written by birt June 18, 2013 (3 years ago)

      You could probably find it on Google. However, keep in mind that unfortunately most commercial EAs will not work with it. Although using it is very cumbersome because it can no longer connect to the MT4 servers, it should be fine if you only use it for your own strategy development.

  • #17 written by Esteban June 28, 2013 (3 years ago)

    Hi Birt, does this script works with last build 509?

    I would really love to buy TDS but unfortunately I cannot spend 99usd +10monthly fee now.

    I only need one license but there is no cheaper opions for those wating to buy only 1 license.

    • #18 written by birt June 29, 2013 (3 years ago)

      I’m afraid the script doesn’t work with any build past 408. However, if you’re only doing your own development (and not backtesting commercial EAs) you could probably use build 402 or 408 but it’s not very easy.

  • #19 written by jok July 9, 2013 (3 years ago)

    do we have any options, besides purchasing tds to be able to use tick data on 509?

  • #20 written by George August 2, 2014 (2 years ago)

    Birt’s Patch script to v0.21 support up to build 409.

    I am running build 670.

    So how should i proceed with backtesting after following the guide all the way till this point?

    Hope to hear from you soon


    • #21 written by birt August 2, 2014 (2 years ago)

      This patch script is obsolete and no longer supported. It does not and will not work with any build past 409.

      I advise using the Tick Data Suite instead, it has all the functionality that the patch script has plus much more.

  • #22 written by George August 2, 2014 (2 years ago)

    I can’t seem to find Microsoft Visual C++ 10 runtime from the download page as per instructed.

  • You may use these HTML tags: <a> <abbr> <acronym> <b> <blockquote> <cite> <code> <del> <em> <i> <q> <s> <strike> <strong>


  • Comment Feed for this Post
Go to Top