Questions about MQL4 - page 10

 
Slawa,
OK. Thank you.
Now I have to meditate for a while...
 
I can't wait for an updated ME and a new build.
It's impossible to write anything well...
The forum is indispensable in that sense.
Thanks again.
 
Myxu
try using ArrayCopy();


tried it. it makes absolutely no sense. the speed is identical.

and with local variables, it's 5 times faster.
 
<br / translate="no"> tried it. it makes absolutely no sense. the speed is identical.
It's 5 times faster with local variables.


How long does it take in your code?
 
I have one turkey where it takes all the time, practically. :)
statistical chronometric pattern analyzer :)

On each bar it accesses different Close[] about 2000 times,
and then it takes a lot to arrays. I have to check it before each access to the array with a bunch of if()'s.
I'm not even trying to convert it to HLC :)

but I'd like to develop the idea, because it brings some profits.
 
1. How long does the task still take?
2. Is there no loop or infinite loop in the indicator?
 
I use IndicatorCounted() as well, but initialization takes 10-30 seconds on Athlon 1700... and I want to add more frills...

If I just insert this construct in one place, speed increases by 2 times.

and in general the speed of accessing arrays and local variables differs by 10 times.
 
I was just thinking... maybe I should make a DLL...
can anyone recommend a small, fast compiler?
Preferably C or Pascal.
 
With such a long time, there's clearly something wrong with the code.
I am working in an endless loop, approx. 2000 lines of code, including processing arrays and redrawing graph objects. One loop takes about 10-12 ms. Between ticks it manages to wrap around 30-500 times.
MT is very fast. Look for the problem in your code.
 
er... try something like this yourself...
    t2=LocalTime(); for(d=5000 ;d>0;d--) for(k=1;k<5000;k++){ z=Close[k];y=Close[k+1];x=Close[k+2]; z=Open[k];y=Open[k+1];x=Open[k+2]; }