Get Back Your Money

Tuesday, February 15, 2011

My Backtest is Running Slowly

I think there is something very disturbing in the development of EA Pipscola. EA is running very slow in backtest mode. There are several possibilities that be the cause. I read some suggestions for upgrading a PC that I use. Others suggested to optimize the program code on Indicator and Expert Advisor.
But the problems that I experienced only occur in the period 2009-2010. Weird is not it? For more details, as I do backtest using data from the period 2005-2008, the time needed to complete this process faster than the period 2009-2010. This is very annoying. To be honest until now I can not explain why this could occur. But from this incident I could learn a few things.
Processor
Processor is the core of a computer. The speed and performance of a PC can be seen from the processor it uses. Processor that we usually use today are no longer using a core, but consists of several cores. Okay, it allows us to open several applications at once (multitasking). It's nice when we're optimizing an EA and at the same time still be able to enjoy High Definition video.
Maybe you think if I let Metatrader run alone then the optimization process will run faster. Unfortunately what you think only happens if my computer is still using single core processor. If my computer uses dual-core processor, then there is a unused core practically by Metatrader. EA only runs on a single thread. Even all the EA that are running on a Metatrader share the same thread.
Optimizing the code
In the end I found a way to increase the performance of EA Pipscola during backtest. Apparently myscreen function () which I use to display some information on the chart causes backtest process becomes very slow. So I modify the code to be executed only during live trading. You do this by adding the code
if (! IsTesting ())
just before calling
myscreen ();
. So the complete code is now
if (! IsTesting ()) myscreen ();
this code can be applied to all versions of Pipscola. This optimization can improve the performance of EA Pipscola more than 20% during backtest.

Risk Warning

Please note that Trading in the Foreign Exchange market might carry potential rewards, but also potential risks. You must be aware of the risks and are willing to accept them in order to trade in the foreign exchange market. Don't trade with money you can't afford to lose.