Backtesting is slow for certain EAs


some pro coders please reply me.

why on some EAs backtesting speed is too fast and on another ones it is too slow?

and how to speed up backtesting speed on slower ones?

thank you previously

Because of the calculation/coding complexity.


if it takes too long, you can first backtest or optimize it with open bars, which will make it faster.

Then you filter the best results and fine tune it with higher tick accuracy.

There is a good video on youtube that explains it:

do you mean its speed is up to coding type based on open price or close price or any other type such these?

can you explain more ?

is there a way to change that code by a programmer to speed that up?

how to speed up that?

Get a faster computer.

Don’t do per tick what you can do per bar or per order.

void OnTick(){
   static datetime time0=0; datetime timep=time0; time0=Time[0];
   bool isNewBar = timep != time0;

   #define PRICE_MIN 0
   static double buyLevel=PRICE_MAX, sellLevel=PRICE_MIN;
      buyLevel=PRICE_MAX; sellLevel=PRICE_MIN;
      // calls to indicators etc. goes here.
      if(isBuyCondition)   buyLevel= ...;
      if(isSellCondition) sellLevel= ...;
   if(Bid >= buyLevel){
      // reevaluate buy conditions/SL/TP if necessary
      // calls to indicators etc. goes here.
      // compute lots
      // open buy
   else if(Bid <= sellLevel){
   // else nothing to do yet, except maybe update status.

The cause is low quality coding and lack of optimization. Testing is blazing fast with properly written code.

i dont know anything about coding i am a pro trader but dont know anything about coding.

how can i know if a programmer coded my EA properly ?

Run it in the tester, and see if it does what you want it to do.