Questions about MQL4 - page 11

 
Here's what I don't understand...
Why do you have to write code so ugly? You can't understand anything.
Do I have to ask leading questions to understand what your problem is?

Are these loops nested or not nested?
If nested, where are the parentheses? If not, why did you put it here?
There is no loop over d anywhere in the indexes.
Why should I assign different values to one and the same variable without handling them in any way?

I'd better go...)
 
Or maybe we could slap together a DLL.

What's the big deal? With your skills, you can start writing the code for the whole terminal right away.
 
of course loops are nested!
there's nothing wrong with parentheses.
damn it.

is just a speed test. don't you get it?
and the style is so messy for the same reason.
well, let's format it...
   
//////////////////////////// int init(){ double x,y,z; //////////////////////////// int t2=LocalTime(); for(int d=5000 ;d>0;d--) { for(int 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]; } Print("Done in ",LocalTime()-t2," Seconds."); }//////////////////////////


Once again, let me explain my problem.
array access is ten times slower than local variables. how do I get around this?

 
а может быть, ДЛЛку сляпать

What's the big deal? With your skills, you can start writing code for the whole terminal.

What do you mean? Am I reinventing the wheel?
 
If the cycles are nested, then 5000 x 5000 = 25mn cycles
but initialization takes 10-30 seconds

Roughly 1 million cycles per second!
And if we take into account index calculations, array calls and assignment operator execution, we get roughly about 10 million operations per second.

To my mind, that's not too little at all.
Maybe, in all Forex there isn't so much information, how much MT can process in 1 second. :)
 
the loops are nested, of course! <br / translate="no"> brackets are fine there.
Oh, man.

it's just a speed test. don't you get it?
That's why the style is so sloppy.
...
Let me explain my problem once again.
Accessing an array is ten times slower than accessing local variables.


Reminds me of an anecdote about Siberian men and a Japanese chainsaw, when they put an iron pole up against it.

"Ding," said the Japanese chainsaw.
"Uh-huh," said the Siberian men.

So are we going to make money or win? (rhetorical question).
 
!:)
I heard 'em say, "That's right!"
They say there was a japanese guy crawling around, pulling men by the sleeve, saying, "no, no, no."
The men said, "shit."

Really, I'm going to work...:)
 
Thank you, that makes me laugh. :))))))))

I'm not saying that MQL4 is slow. Quite the contrary.


But! er...
the only question is, would it work much faster if you put array processing in a DLL?

Who's got a compiler of some kind installed? please check it out! is it that boring?
 
Thanks, that makes me laugh. :))))))))<br / translate="no">
i'm not saying that MQL4 is slow. quite the contrary.


but eh...
the only question is, would it be faster if you put array handling in a DLL?

Who has installed a compiler of some kind? Check it out, please!


It works much faster, about 10 times faster if you write it correctly.
 
Begun, thank you very much!

It remains to be seen which is faster, the far function call or the ten array calls.

I just need to find some small compiler for.............
Reason: