How to speed up backtest time ?

 

Hi, I don't know if it's normal but when I test a EA on two month of time, backtest finish in two hour or more (tick by tich method). I know of people spend few minute for the same operation. What's wrong ?

Actually when I test an EA I wanna try more time frame and more variable combinations but with so time consuming ....

Thanks

Dan

 
maybe turn off visualisation
 

Take a look at your EA and see what it does on each tick, and minimize the workload.

Some indicators are not written very well, and may contribute to your slowness.

 
Dainesi wrote >>

Hi, I don't know if it's normal but when I test a EA on two month of time, backtest finish in two hour or more (tick by tich method). I know of people spend few minute for the same operation. What's wrong ?

Actually when I test an EA I wanna try more time frame and more variable combinations but with so time consuming ....

Thanks

Dan

the question is how many variables are you optimizing at a time and how many steps you are using over what length of time. Obviously, the more data the computer has to analyze the longer it is going to take. It is also a function of your coding your CPU and computer capacity. If your coding is not effecient or it is incorrect it will take longer as well. All of these are factors you must address in your EA design.

 

D

For example...

If your entry signal calls many indicators, check the values of the standard ones first, eg

if (RSI value OK to buy)
{
   if (MACD value OK to buy)
    {
      if (iCustom ("Big Slow Number Crunching Indicator" value OK to buy)
        {
          OrderSend(Buy.....);
        }
    }
  }

Review if your system needs to check for open each tick or just on completion of the prior bar

Also, if your OrderClose logic is lengthy to process, only run it if orders are open

FWIW

-BB-

 

if u want to have quicker backtest speed, please select "Control points" for the Model, as it is not big difference with using EveryTick Mode, but the Speed improve a lot

 
kelly:

if u want to have quicker backtest speed, please select "Control points" for the Model, as it is not big difference with using EveryTick Mode, but the Speed improve a lot

This is an inaccurate statement, kelly.

It may be true for your EA, however, depending upon what other EAs do tick by tick, this can have either a huge difference or virtually none.

Backtest performance will be especially hampered if there is logic performed with each tick such as:

- repetitive logic eg. looping logic through order history

- logic with latency eg. file access, dll access

- heavyweight logic eg. complex calculations with many variables

- poorly written logic

Depending upon your EA, it can make sense to create a LIVE and TEST mode, configurable by an extern variable, in order to allow certain functionality to be bypassed for strategy tester runs.


CB

Reason: