[TUTORIAL] Complete Backtesting and Analysis Setup (100% Free)

Hello,

I am having the problem shown in picture, can you please help me resolve this issue.


Hi thunder,

I’m having a hard time seeing what the error says, could you make the picture larger or just type it out?

Hello there,

In the Journal is states, TestGenerator: internal error because the file not opened.

I have already found the solution, it involved installing MT4 again as my previous attempts to achieve 90% modeling quality (by using methods from other websites) failed and caused this error. I am now successfully back testing using your method and its great. :slight_smile:

I guess sometimes a little restart is all it needs! That’s great, glad it’s working now. :slight_smile:

Clark – great thread. Very useful for a newbie trader like myself.

I have a question: Is the SQ Tick Data Downloader limited to years 2007-2013? The “Download From” tab mostly shows the start date for most pairs at 2007, and I cannot seem to go back any further whenever I click the calendar. Thanks in advance.

Also, are you @ClarkFx at twitter? :smiley:

Yes, that is all the data that is available for download from the Dukascopy servers. And no, that’s not my Twitter. :wink:

Thanks a lot Clark! :slight_smile:

*Edited
Clark, whenever I stop the download (because I need to turn off the laptop) a pop up shows “Do you want to regenerate CSV file from downloaded data.” May I ask what does this mean? :smiley:

The downloader first downloads the tick data in the format of “.bi5”, from these files, the “regenerates” and combines it into .csv files.

Hope that helps. :slight_smile:

Hi there ClarkFX

I just tried running the python script and got the following errors in command prompt:

Microsoft Windows [Version 6.1.7601]
Copyright © 2009 Microsoft Corporation. All rights reserved.


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.


F:\SQ_TickDataDownloader	ickdata>D2MT4.PY
Filename: EURUSD.CSV
Traceback (most recent call last):
  File "F:\SQ_TickDataDownloader	ickdata\D2MT4.py", line 5, in <module>
    path = input("Filename: ")
  File "<string>", line 1, in <module>
NameError: name 'EURUSD' is not defined

F:\SQ_TickDataDownloader	ickdata>

Do you know what caused this and how to fix it?

fixed: I installed python 3.3 but also had older version2.7 installed. The 3.3 did not update or overwrite 2.7 so I needed to uninstall it all and reinstall. now working

Morning Raptor, sorry I didn’t get a chance to reply; it was 3:00am my local time when you made the first post.
But yes, the script runs on Python 3. You can set that to your default Python even if you have both installed. :slight_smile:

Hi ClarkFX, this is a great guide - very useful :35:

I have a problem with the ‘vanilla’ MT4 version that I downloaded from the link you gave, in that it doesn’t include all currency pairs :-/
It isn’t that it’s not displaying them all in Market Watch, as I’ve shown all. It looks like the version of MT4 from the MetaTrader site just doesn’t include all of the pairs - or am I missing something?

It looks like I can’t create history data for all of the pairs I want to test on.

Do you know how to add pairs that are missing?

Any help/suggestions would be much appreciated. Thanks

Hey Nibbles,

Thanks for the feedback.

Try this:

  1. Download and install MT4.
  2. Open a demo account, make sure you’re connected to a real-time price feed (you’ll know you are if the server time is moving and price ticks are coming in).
  3. Right click on your Market Watch, and select “Show All”. All available symbols will be displayed and you may organize as you prefer.
  4. Once the symbols are loaded
 Disconnect and delete (so it does not automatically log-in every time you launch it, and re-writes your data) that account off your MT4 (“Navigator” window) and restart your terminal.
  5. You should now have all access to all the symbols available on your Market Watch and your Quote Manager.

The feeds between brokers differ so make sure you download your MT4 from brokers you know will have the pairs you are looking to use. I haven’t used MT4 in about a year, so let me know if that doesn’t work.

Hi Clark,

can you please advise how can i do the backtest for about 5 years? when i do the backtest from 2010 to 2014 it stop the test in middle of 2013 then I have to run the test again from 2013 to 2014. BU I would like to do the one test for 5 year o rmore

Hi Clark,

Thanks for your previous help, that worked a treat :slight_smile:

I’m having real problems with MT4 history files - have been for a few days now, trying different things :-/

I got tick data for GBPNZD, converted it to 1 minute bars, imported it into the history (cancelled through the account login) - this created a GBPNZD1.hst file that was fine.
Then I opened the chart and applied the Period_Convertor_Opt, ensuring DLL imports was checked (as per comments in the indicator) and set the period multiplier to 60.

That created a csv file that looks fine, nice 1 hr bar data from start to end (checked in excel.

Unfortunately it also overwrote the 1 min chart that was currently showing (up until the last hour) with hour bars - I’m guessing it didn’t do the last 1 hr bar because it only went to 21:57 on Feb 28 2014, hence not a full hour.
What I mean by that is that the chart basically had 1 hr bars up until the last 57 minutes, then they were 1 minute bars!

So I did it all again and kept a copy of the GBPNZD1hst this time.

So, I have the nice GBPNZD60 csv file and import that into MT4 (selecting the 1hr timeframe) - however, upon restarting MT4 and trying to open offline there is only the GBPNZD1.hst showing (and of course this is the now corrupted 1 minute hst file), even though I imported the 1 hr csv using the 1 hr timeframe.

This is driving me nuts - either I’m doing something wrong or MT4 is seriously messed up :-/

Any ideas as to what might be causing the problem, please?

I’d check the EA and/or data, it shouldn’t freeze midway.

Make sure you have selected GBPNZD 1H timeframe under the Quote Manager when importing.

hello sir , i have a problem
when i run D2MT4.py then it does not create EURUSD_1m.csv file while i enter the details correct as EURUSD in the command prompt and hit enter. it does not creates a new file ?
reply me sir what to do ?

Clark-
Tutorial was easy to follow and I completed it successfully. Simple question though, the data is in 1/10 of what it should be. ie a 30 pip bar is 3 pips, any ideas on what causes this or how to fix it?
Thanks

Default MT4 installation is setup to accept Min Lot Size of 0.1 and Lot Step of 0.1. Was any of you able to change that default configuration? I want to use microlots instead of minilots but I can’t find the way. I searched in google and in MT4 forums, and I’m not the one with this issue but no one gives a solution.