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

Hi alfonsomg, you can change it once it’s installed - in Tools/Options and then select the Trade tab. HTH

Thanks for helping out the others! :slight_smile:

hi, Clark:
I have an issue with backtesting which I hope u can help me out (cos to me u r like an expert on this):
The historical data I download from Metaquotes using History Center in MT4 (F2) is full of holes, meaning many bars are missing from time to time. Other historical data I downloaded from forextester, for example, has its own cons like 4 decimal and some missing data too.
I tried using Tickstory but I have some problems in the download process.
So, can you help me with this by sending me historical data of 1 minute including Volume data (it’s very important for mt4 to produce “Tick” data from that). ThX in advance!

Shuo

Hi Shuo,

I’m not sure if Clark (or anyone) will send you data as the files are usually massive, Gigabytes in size :-/

If you have a problem with Tickstory, have you tried StrategyQuant Tick Data Downloader? The link is …

StrategyQuant Tick Data Downloader

I’ve used both and they both do the job :slight_smile:

HTH

hi, Mr. Nibbles:
Thank you for your reply! Unfortunately I am looking for ‘historical data of 1 MINUTE including Volume data’, not tick.

Can anyone help? Clark?

Shuo

I understood what you meant, and it is the fxt files that I was referring to when I said they were massive - they are far bigger than the downloaded tick files :o

Also, it is most likely that any data people have, from 1 MINUTE upwards, [B]will [/B]have been created from tick data that has been downloaded - as tick data is generally considered to be the most accurate way to create the fxt and hst files for MT4. :slight_smile:

I did not ask tick data, I know why.
I don’t need the ticks inside the bar.
All I need is 1 minute bar + volume data.
Not ticks.
Once again:
No tick data needed and I don’t want to generate bars.

Maybe this way:
No tick data needed

Did you try Histdata?

hi, jp78, thx for your reply. Unfortunately it doesn’t give accurate 1 minute data with 90% modelling quality and without holes. Anything else you got?

Hi Clark, or others who may be able to help.

First, Thanks for kindly posting an intro to backtesting in mt4 for newbies! That’s me, and much respect for your giving mood.

However I’m stuck already… cant get the py script to run conversion. I downloaded GBPUSD data from 1st July 2005 to 20th July 2014. I open D2MT4 (which is in tickdata folder with the GBPUSD folder), type in GBPUSD, hit enter, it (that little black command screen thing) flashes a few extra lines of something and then disappears so quickly so I cant read it. I have python 3.4.

Tried disabling Norton anti-virus, allowing permissions, re-start, to no avail. I’m no computer expert, yet! Bloke on the page before seemed to mention same thing. Guess I’ll just keep test trading my system manually :confused:

It took me a few goes but I managed to snap a pic before the message disappeared. Says at the end… FileNotFoundError: (Errno 2) No such file or directory: ‘GBPUSD.csv’

Anyone know what I can do to get this to work?

Hi wattsy,

I’m not a Python expert but I did work in IT for 20 years on the whole development life cycle, so I’ve got a couple of ideas that may help.

The message says it can’t find the file - so, first check the file name exists (I’m guessing it does) - if it does, and it’s not a problem with upper/lower case in the filename, then I would guess that it’s looking in the ‘wrong’ directory - so maybe the file has to be in a specific directory that is mentioned in the program, or there is a default directory mentioned in Python settings??

Another possibility is that you have to navigate to the directory where the file is before running the program, if running it in a command window?

As I say, I don’t know Python, my ideas are based on 20 years of working on problem solving in IT.

I hope that’s some help :slight_smile:

Hi Mr Nibbles
Thanks for the assist! I hear where you’re coming from. I did try writing the complete path. Tried in a different file/path. Tried upper and lower case, and tried creating a folder gbpusd.csv for it! No luck so far. Its gotta be a simple thing. Seems its worked before for others. I’ll dabble a little more then put this one on the backburner for a bit. It was my first attempt at running a backtest through MT4. I can look at other ways. I’ll let everyone know to stop worrying about me if I get it to work :wink:

Doing lots of reading of forums to learn in the meantime. Been demo trading a o/b o/s strategy I came up with for the last 5 months. Good practice to learn sticking to trading rules, plus a million other things!

Thanks and many pips your way.

Hi Clark,

Great post, thank you so much for taking the time to organize the steps, provide screenshots, and tools. Most people aren’t so willing to help others, too busy trying to get their own I guess… Anyways, i’m just starting with EA’s. I know how to code so I thought I should apply my skills here :slight_smile:

I’m having some trouble with your Period_Converter_Opt indicator. It works as an indicator correct? I added it to the indicators folder, opened it in MetaEditor, compiled it (compiled successfully), then it appeared in my indicator list, I try to drag it onto the chart BUT I get no popup to set the parameters, and in the terminal it says:

2014.07.30 22:52:03.548 Custom indicator Period_Converter_Opt EURUSD,M1: removed
2014.07.30 22:52:03.548 Custom indicator Period_Converter_Opt EURUSD,M1: loaded successfully

notice the same timestamp? It gets removed immediately after I add it, and like I said no popup. I’m wondering how everyone else got it to work so easily… I got upto this step quite easily. So close!!

Anyways, hope you can help me!

Thanks again

Tried to solve this on my own by creating a python script which converted the minute data (from csv) to which ever period I specified, I was going to share it on here as well, worked great, BUT… it works by taking the rows X at a time (whatever period, 15, 60, etc.) and calculating the open, high, low and close. I didn’t foresee the problem that not all bars are included in the minute data, so this means that you can’t take X at a time because if some minutes are missing, it will start fudging up the periods… so, back to square one. I’ll see if I can fiddle with my script to get it to to look and sort by the timestamps, but not yet sure how exactly to approach this. Maybe i’ll look at your D2MT4 script and see if theres any logic I can borrow from, you must be doing this sort of check when converting tick data to minutes correct?

Anyways, my objective is to convert minute data to hourly, daily, etc. so I can test my EAs… originally I was following the steps laid out (very nicely) by the OP, but i’m stuck at the Period_Converter_Opt step… (see above post), hence trying to create my own converter…

New Question (related):

When I open my MT4 and connect to my broker (OANDA, demo), I see data going back to 2002. Why can’t I simply use this data to backtest?

A major takeaway from this thread is to never connect, always work offline, and we go through a long process of downloading data, converting it, etc. Can someone please explain why we don’t just use the data that’s provided by the broker that we see in the MT4 charts?

Thanks.

Rightly said… Go to dukascopy.com and download the data for required TF instead of converting…

Hello everyone.

I got a problem with my historical data. All of the candles are the same.
Have anyone some idea what the problem may be?

Took a hiatus from Babypips, but I’ll be looking over this thread and make any changes needed.

Most broker data is not of the best quality, with many gaps and irregularities that one cannot generally spot visually.