back test speed Decreases ?!

 

hi,

run ea back test , in every tick mode. I run it on long time , from 2000

in first 24 hour's for back testing my ea , it will have 8 year's , but after that in each 24 hours have only 2-3 year . ( by my PC.)

whats the problem? can do some thing ?

 
Likely you have an indicator recalculating all bars per tick (and the number of bars is increasing.) Fix the broken indicator.
 
whroeder1:
Likely you have an indicator recalculating all bars per tick (and the number of bars is increasing.) Fix the broken indicator.

THANK you to reply.

i rewrite all my indicators in EA . so there is no iCustom function. and for the indicator i use 6 array[3000] to store as  buffer.

the expert have large algorithem . more than 5500 line in code. and so many calculation.

molty time frame , multy currency, 

all them are used from the first. so should not to be different between fist 24 hour and the other. 

for first 24 hour it past from 2000.01.01 to 2008.01.... and for

(approximately ) 2th 24 hour it past to 2010.02 and in 3th 24 hour it was 2012.08 and 

after 77 hour it is at 2013.04.... and its continuing....

is this explanation will clearly some thing ?

 
Mehrdad Shiri: i rewrite all my indicators in EA . so there is no iCustom function
That is likely your problem. Don't try do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into the EA and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
          Detailed explanation of iCustom - MQL4 and MetaTrader 4 - MQL4 programming forum
 
whroeder1:
That is likely your problem. Don't try do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into the EA and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
          Detailed explanation of iCustom - MQL4 and MetaTrader 4 - MQL4 programming forum

THANK you to reply.

 
whroeder1:
That is likely your problem. Don't try do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into the EA and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
          Detailed explanation of iCustom - MQL4 and MetaTrader 4 - MQL4 programming forum

what about technical indicators

for example : IMA

if used as below 

moving_average_=iMA(.....);

IS IT HAVE THE SAME EFFECT ?

if it use in long time of back test , will reduce the speed?

 
A properly coded indicator only recalculates bar zero (after the first initial run.) Speed is independent of the number of bars. Your problem is a dependency of the number of bars.
 
whroeder1:
A properly coded indicator only recalculates bar zero (after the first initial run.) Speed is independent of the number of bars. Your problem is a dependency of the number of bars.

with tnx. and

1- CAN YOU please say this with simple word and more explanation ?

thank you. 

and

2-about this :

whroeder1:
That is likely your problem. Don't try do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)

i have this in my code :


double Buffer1[];
double Buffer2[];
double Buffer13[];

//==========================================================================================================
countedBars=3500;
if(prevtime != Time[0])
       {
        prevtime = Time[0];
        prev_calculated=countedBars;
        rates_total=countedBars;
       }
if(prevtime == Time[0])
       {
        rates_total=countedBars;
        prev_calculated=countedBars;
       }
if(prev_calculated==0)
        _limit=rates_total;  //    -1;
     else
       _limit=rates_total-prev_calculated;
       
  /////  ////////////////////   
if(prevtime != Time[0])
       {
        prevtime = Time[0];
        prev_calculated=countedBars-1;
        rates_total=countedBars;
       }
if(prevtime == Time[0])
       {
        rates_total=countedBars;
        prev_calculated=countedBars;
       } 
ArrayResize(Buffer1,countedBars);ArrayInitialize(Buffer1,0.0);
ArrayResize(Buffer2,countedBars);ArrayInitialize(Buffer2,0.0);
ArrayResize(Buffer3,countedBars);ArrayInitialize(Buffer3,0.0);     
//===========================================================================================================

so i was expect a limitation.

 

i can not see this page on General forum.?!

 
Mehrdad Shiri:

i can not see this page on General forum.?!

mql4/MT4 topic in mql4/MT4 section.
 
Alain Verleyen:
mql4/MT4 topic in mql4/MT4 section.

ok. thank you.

Reason: