You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
What do you know about constant expressions?
Of course both of them was caclulated on compile time
takes the same time as
bc all constant expressions get processed the same by compiler no matter how many comparisons inside the constant expression or how complex
Try to run this code in the MT5 (64 bit version)
Ha! Apparently MQL5 compiler is smarter than MQL4. So I've modified my test code to this for MT5:
And got these results:
So, as before, there is no clear winner. Time fluctuations, given their magnitude of <100 milliseconds for 2147483647 operations (inclusive of 2 x MathRand on top of < or <=), are likely due to pc load.
Ha! Apparently MQL5 compiler is smarter than MQL4. So I've modified my test code to this for MT5:
And got these results:
So, as before, there is no clear winner. Time fluctuations, given their magnitude of <100 milliseconds for 2147483647 operations (inclusive of 2 x MathRand on top of < or <=), are likely due to pc load.
awesome info!!
and also everyone else who posted
If I can add my 2 cents here... I also was eternally worried about code and processing speed... but... the bottom line is this:
Electricity travels at just under the speed of light... light speeds around the Earth at I think 7.5 revolutions per second...
So, yes... there is possibly a difference in speed...
But is it negligible.....
100000000000 iterations of <=10 take 3 minutes 54 secs.
So the winner is <=10 even if I believe its a tie.
100000000000 iterations of <11 take 3 minutes 55 secs.
100000000000 iterations of <=10 take 3 minutes 54 secs.
So the winner is <=10 even if I believe its a tie.
Nitpicking:
Are you 100% sure that there were no other system processes running in the background while you were running "<" test?
For example: did windows update run? antivirus regular check? Chrome browser update check? Chat apps received messages with images and/or videos? Maybe MT4 downloaded new version in background? Any other windows process that could use processor time?
In short: can you claim that both tests had EXACTLY the same computing environment?
Are you bored?
Why don't you check if A=A+ 3 is faster or slower than A=A+13 for instance? If you check for 100 milion runs, it will show a small difference as well.
It's exactly the same, no matter what your 'tests' show.
And it will not make any slightest difference in making a better ea, why don't you accept metaquotes answer.. It's just a false question, false problem. Nothing, not worth any more reference.
Nitpicking:
Are you 100% sure that there were no other system processes running in the background while you were running "<" test?
For example: did windows update run? antivirus regular check? Chrome browser update check? Chat apps received messages with images and/or videos? Maybe MT4 downloaded new version in background? Any other windows process that could use processor time?
In short: can you claim that both tests had EXACTLY the same computing environment?
Of course its just a pc load issue.
Why do you guys still bothered about this non relevant non-issue which was already resolved by official metaquotes answer (that they are exactly the same in MT5 and MT5) ?
Are you bored?
Why don't you check if A=A+ 3 is faster or slower than A=A+13 for instance? If you check for 100 milion runs, it will show a small difference as well.
It's exactly the same, no matter what your 'tests' show.
And it will not make any slightest difference in making a better ea, why don't you accept metaquotes answer.. It's just a false question, false problem. Nothing, not worth any more reference.