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

i added isFloat function to D2MT4.py python script because i have got error while running that script



def isFloat(value):
	try:
		float(value)
		return True
	except ValueError:
		return False

path = input("Filename: ")
x = 1

file = open(path+".csv", 'r')
outfile = open(path+"_1m.csv", 'w')

linenum = 1
prevDT = ""

for aline in file:

        value = aline.split(',')
        datetime = value[0]
        currentDT = datetime[0:16]

        if linenum == 1:
            openP = value[x]
            highP = openP
            lowP = openP
            closeP = openP
            volume = 1
            prevDT = currentDT

        else:
            if currentDT == prevDT:
                volume += 1

                if isFloat((value[x])):
                        closeP = float(value[x])
                        if float(value[x]) > float(highP):
                            highP = value[x]
                        if float(value[x]) < float(lowP):
                            lowP = value[x]

            elif currentDT != prevDT:
                outfile.write(str(prevDT)+","+str(openP)+","+str(highP)+","+str(lowP)+","+str(closeP)+","+str(volume)+"
")
                openP = value[x]
                highP = openP
                lowP = openP
                closeP = openP
                volume = 1
                prevDT = currentDT

        linenum += 1

file.close()
outfile.close()

Can anyone answer this question - I had an EA developed by a programmer at MT4 site - the programmer placed a copyright behind the EA I asked to be made - is this normal - thanks in advance for your answers

don’t buy any forex robot without real forward test and has been made withdraw

Hi,

I write my own EAs so I don’t know if this is ‘normal’ practice, but here are my thoughts …

They may have been able to put copyright on the actual coding, as that is their work, but whether that applies to the [B]idea[/B] behind the coding I’m not so sure. Don’t think you can copyright an idea, but I’m not an expert by any means.
If that’s true then it would only protect the actual code the programmer has written, so you couldn’t sell it for example - and as a program can be written in many, many different ways to do the same thing, it wouldn’t stop it being written in an alternative way by you, and you’d be free to do what you want with it.

As I say, I’m not an expert on copyright so you’d need further input.

HTH a little bit :slight_smile:

Typically, upon completion the developer should give you full rights. It’s fishy they’d do something like that. I’d talk to them about it.

Hi ClarkFX, thanks for all the help and info.
I have downloaded MT4 however the file path indicated -[U][B][I] 2) Place the “Period_Converter_Opt.mq4” and “Period_Converter_Opt.ex4” files in the indicators folder of your MetaTrader 4 you just downloaded. Ex) “C:\Program Files (x86)\MetaTrader 4\experts\indicators”[/I][/B][/U] - is not present in MT4 anymore. Is there another way I can get these files to where they need to be - please help. Thanks in advance.

Hi guys, i wanted to do this so i can back test EA’s accurately but hit a roadblock. When i go to convert my downloaded tick data into .CSV via D2MT4 app that is placed in the tickfolder as per instructions. it comes up with an error message that is displayed at the speed of light. so in 2015 can this method still me used? Clark bro if your still about i could do with a little saving.

'best

darth

Use tickstorylite bro. Saves a whole lot of ducking around when it comes to data conversion.

Cheers bro. you saved me. :wink:

'best

darth

First of all congratulation of your work!! I would like to report that the indicator Period_Converter_Opt doesn’t work for me. When drag and drop into any chart error appear in the Journal tab like “Expert ‘Period_Converter_Opt’ is not custom indicator and will be removed”. I really need to work MT4 back-testing with your method.
So thanks Again!

Hi Clark,

When drag and drop into any chart error appear in the Journal tab like “Expert ‘Period_Converter_Opt’ is not custom indicator and will be removed”.
What to do?

regards,

Louis Witte

Clark…I know this is an old thread…but I’ve gotta say…Outstanding Job!!! Extremely Helpful.

I’ve followed all the steps…I have all my time frames in MT4. I attempted a sample backtest and the test is terminated after the first close order. Here is a copy of the journal. I attempted this with other time frames and different EA’s…all with the same results. Any adivice???

Update: I thought perhaps it was attempting to calculate the conversion price so I also loaded AUDUSD and USDCAD. I was able to complete a successful test with both…but when I attempt to test it on a Cross Pair (AUDCAD)…it gives these errors. Thoughts?

Hi! @ClarkFX t seems that the py script can’t be downloaded from the links I see here. It says server IP Address cannot be found. Any other link to this?

The Py script is in the zip file in the 3rd post. Download the file and unzip and there you go.

Hi, thanks a lot for your post Clark. Unfortunately I have problem downloading MT4 without broker license. In metaquotes.net and metatrader4.com there is only mt5 for download. So can you provide another download link for that?

Not sure you noticed, but Clark’s post was from 2014! You can click on the letter C next to his name, and then click on the letter C again to see Clark’s profile, and there, you’ll see that he hasn’t been on the site since November 2018.

You can get MT4 from several places. One being from your broker if they support it. Or, the MT4 website itself, as you’ve tried. I think you just need to look a bit further down the page.

Second orange button.

His last post in this thread is from Dec’ 14, so I think he is still around.
I have tried that second button, believe it or not, it is mt5 also.
So my question is: using broker license free mt4 is mandatory for this method of backtesting?

That’s December, 2014. Not the 14th of December, 2019.

:joy::sweat_smile:
Ok. what about other questions?

Hi guys,

I still receive notifications in my inbox for this thread. I’m impressed that it’s still active and being used occasionally! :grinning:

As I haven’t used MT4 in many years (and have never used MT5), I’m afraid I’m pretty out of the loop with it. The initial post was made in 2013, and a lot has changed since. Mostly for the better. There are more robust and efficient workflows compared to 7 years ago. I would strongly encourage doing your homework to see what’s available.

1 Like