Developing and Testing Expert Advisors

Everything related to MT4

Developing and Testing Expert Advisors

Postby User » Fri Jul 03, 2009 4:16 pm

Forum stransfer: Submitted by Joe T on April 21, 2009 - 18:34.

I am very new to Forex, and MQL.

I am trying to learn as much as I can, as soon as I can. However, I have a day job and a family, and unfortunately I simply do not have the time to spend in front of a computer to trade the way I'd need to trade in order to make a living doing it, especially with the amount of capital I am starting with.

And so, I am taking it upon myself to develop (in whatever free time I have) some EAs based on strategies here, and then tweaked based on testing and optimization. I do not want to run just any old thing, and I have a lot of different things I want to test before I run with things. I also wish to devise EAs that stand the test of the last 10 years, not just the last 3 months. I have different ideas on how to accomplish that, but I need time.

One of my big issues at the moment is that the testing and optimization process takes a very long time to run through. I can literally test a given strategy for two weeks on one currency pair alone because it takes hours to go through a certain number of scenarios on the full 10 years of data. I don't want to run it continuously because it's the family computer, and the optimization process slows other processes down significantly.

I am considering buying a new computer strictly for testing. But before I do that, I am hoping that one of the reasons why the testing takes so long is my own computer limitation. Can anyone suggest what functionality I should look for in speeding this process up dramatically? Is it simply about the need for more RAM? Are there certain processors that perform better than others? The primary purpose of this computer would be to crank away the testing of EAs. Other than for downloading new data, it doesn't even have to be connected to the internet. (Now I just need to convince my wife that the new, faster, computer should be used for this...)

Any input woould be appreciated.
User
 
Posts: 376
Joined: Wed Jul 01, 2009 7:08 pm

Re: Developing and Testing Expert Advisors

Postby User » Fri Jul 03, 2009 4:17 pm

Forum transfer: Submitted by User on April 23, 2009 - 01:16.

If you are using MT4, and you are backtesting 10 years of data in one test - from my experience you will need as much RAM as possible. Especially if you are loading tick data. I am no expert on MT4. Have done only a small amount of backtesting. However, I think you have to go into the Options and set the max number of bars in history. The more bars, the more memory it uses (at least it did with my computer). So, Im guessing it loads all those bars into RAM. One thing you might investigate is testing 1 year at a time. This may reduce the need for RAM, but I'm not sure. Checkout www.forexfactory.com and pose the question in their forums. Good luck.
User
 
Posts: 376
Joined: Wed Jul 01, 2009 7:08 pm

Re: Developing and Testing Expert Advisors

Postby User » Fri Jul 03, 2009 4:17 pm

Forum transfer: Submitted by Joe T on April 23, 2009 - 20:58.

Thanks. Do I need a log-in on that forum?

My current computer has 1 GB of RAM and 2.0 GHtz processor. When it's cranking away, it is chewing up 80-90% of the processor and 85% of the RAM, so I think I need both a faster processor and more RAM. More RAM on a new computer is easy. A new processor isn't as straightforward. 4 Ghtz processors are dual core, and if MT4 isn't programmed to access both cores, I'll still be limited with 2.0 Ghtz, as it only accesses 50% of the CPU.

I'll peek around and see if anyone knows (1) if MT4 accesses both processors of a dual core, or (2) if there are good options for single-core or hyperthreaded CPU at 4 GHtz. If anyone happens to know, please share. (Probably more of a purely technical question than Forex...)
User
 
Posts: 376
Joined: Wed Jul 01, 2009 7:08 pm

Re: Developing and Testing Expert Advisors

Postby User » Fri Jul 03, 2009 4:18 pm

Forum transfer: Submitted by Sagar on April 27, 2009 - 12:10.

Hello, I am used to test EAs on 4 years of Data, and I saw CPU usage was around 40% to 45%. Not sure about memory usage. Whole testing process finishes in approximately 1 minute or even less. But one thing is sure, one shouldn't open other programs/files while running a test. It does slow down the PC. Wondering, why one need to open other stuffs while a backtest on EA is running?
I have Core 2 Duo Processor 2.0 GHz with 1 GB of RAM. Another thing, it's most likely that backtesting process won't be faster than a limit, as speed depends on processor along with MT4 Tester itself. Best option would be to run a test on your friend/relative's PC having faster processor and bigger RAM.
BTW from where did you get 10 years of data? I need such data desperately! Please share the source :)
Regards,
Sagar.
User
 
Posts: 376
Joined: Wed Jul 01, 2009 7:08 pm

Re: Developing and Testing Expert Advisors

Postby User » Fri Jul 03, 2009 4:19 pm

Forum transfer: Submitted by sam on May 13, 2009 - 11:10.

Have you ever been focusing
Virtual Private Servers and Virtual Desktops such as Commercial Network Services or other MT4 VPS Hostings (e.g. http://www.earnforex.com/forex_vps_hosting.php)?. They perform and execute exactly like stand-alone computers. Good experience are made with CNS (http://commercialnetworkservices.com/VPS/Windows/Traders/). When you are looking at your financial future, perhaps you could consider it best.

Kindest regards
sam
User
 
Posts: 376
Joined: Wed Jul 01, 2009 7:08 pm

Re: Developing and Testing Expert Advisors

Postby User » Fri Jul 03, 2009 4:19 pm

Forum transfer: Submitted by Joe T on May 14, 2009 - 23:03.

Sagar, in your MT platform, you can go to the history center, select a currency, and then download historical data since 1999.

Sam, I am aware of VPS. I considered it, but call me old-school... I like having my own machine (plus, my plan is to bring it to work, plug it in the corner and let it crank away. I doubt I'd be able to access what I needed at work with a VPS. If I actually start making good money using automated trading, I'd probably go with a virtual server. Until then, I'll just plug away with my own stuff. Anyway, here's pretty much what my research yielded:

1) MT4 does not recognize the dual core, as I feared, so it will only utilize half of the 4 GHz available.
2) However, my current computer is an older version with a single 2 Ghz processor, and even though the overall power is the same, the newer CPUs should still operate much faster, so I will gain by getting a new computer.
3) Given my RAM usage of 87%, an upgrade in RAM would probably help considerably even if the processor isn't much faster
4) Currently, there are no CPUs on new machines to anyone's knowledge that I talked to where the partitions exceed 2 Ghz. There are now Quad processors, but that gains me nothing because it will still only access one of them.

After talking with geek friends, IT guys, and others, it was basically settled that, unless I would get into servers and spend a ton of money, I'd be best off just getting a cheap desktop and cranking away. I actually decided on a laptop for portability. So, I'm just doing that - will let it crank away and see how it works.

Besides, I've been trying a new testing approach - using only the latest few months to optimize against current market conditions. The theory is one of momentum - go with what works right now, hope it carries through the next month, re-optimize, do it again.

I'm still testing that theory. We'll see how it goes. But I can foresee larger tests against the full data set in the future.

Thanks for the input.
User
 
Posts: 376
Joined: Wed Jul 01, 2009 7:08 pm


Return to MetaTrader 4



cron