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
Could MT5 be using parallel "multi-threading" approach to certain calculations of which we are unaware?
As @whroeder1 pointed out about the FPU/CPU situations (which completely makes sense), and so calculations could be "spread out" somehow, and the workload of the machine could cause very drastic changes to that environment and affect the results in the "weird" way!
EDIT: What other computational intensive software are you using on your PC? Could there be maybe some heavy floating point math taking place that is stealing "FPU" cycles away from MetaTrader and thus giving the Integer side an advantage?
Sorry, but I don't feel the need to "prove" it by showing my EA code implementations! All that is important for this thread is that it has been shown that the assumptions (mine included) about the faster Integer advantage are no longer a given, and that in many cases Floating-point is actually faster.
Could MT5 be using parallel "multi-threading" approach to certain calculations of which we are unaware?
Probably not, at least what is documented is 1 thread by EA/Script. But who knows ?
As @whroeder1 pointed out about the FPU/CPU situations (which completely makes sense), and so calculations could be "spread out" somehow, and the workload of the machine could cause very drastic changes to that environment and affect the results in the "weird" way!
EDIT: What other computational intensive software are you using on your PC? Could there be maybe some heavy floating point math taking place that is stealing "FPU" cycles away from MetaTrader and thus giving the Integer side an advantage?
Currently not much I think (Chrome a lot of open tabs, MT4/MT5 one instance each, Excel, Skype, Thunderbird). Later I could test with all other applications closed. Also running the script on several charts simultaneously, etc...
The double to int conversion, is no longer part of this thread and that is the reason why I requested the split. This thread is now dedicated to the sole purpose of analysing the speed issues with regards to Integer and Floating point arithmetic.
How I implement the conversion overhead compensation is not relevant here, and pardon me if I do not wish to describe my code implementations with you or anyone else. It is my prerogative to keep my EA code to myself if I so wish it.
I'm not trying to convince you about it either, so you are free to believe or think what ever you want on that matter!
We also agreed that we would start fresh and hold back on all hostilities and keep things civil, so please adhere to that!
It that case, I may be actually be using more FPU intensive applications than you because sometimes I do have MathCAD and Photoshop open at the same time as MetaTrader.
So, I closed everything down and did the test again, but I still get similar results as before! Could it be that maybe your CPU and FPU is implemented differently for your ChipSet?
I'm not really to well informed these days about CPU/FPU/GPU internals, so don't really know if it is a factor or not.
Unfortunately, @whroeder1 has still not answered and I suspect he will not, so we are left to our own devices in order to study this.
It that case, I may be actually be using more FPU intensive applications than you because sometimes I do have MathCAD and Photoshop open at the same time as MetaTrader.
So, I closed everything down and did the test again, but I still get similar results as before! Could it be that maybe your CPU and FPU is implemented differently for your ChipSet?
I suppose yes.
I'm not really to well informed these days about CPU/FPU/GPU internals, so don't really know if it is a factor or not.
Unfortunately, @whroeder1 has still not answered and I suspect he will not, so we are left to our own devices in order to study this.
We will try to figure it out.
EDIT: did you already try on an older computer ?I suppose yes.
We will try to figure it out.
EDIT: did you already try on an older computer ?OK, so here are the results on an older PC:
This is a Server machine that is running multiple services such as my home's multimedia sharing, file services, FTP server, as well as two bittorrent clients.
Please note however, that these are desktop machines and none of them are using Mobile versions of CPUs like your case (which could be an important point).
EDIT: Unfortunately, I no longer have a laptop to test on (as it broke down) and I have not replaced it yet!
I see from the specs that your CPU only has 2 cores, and both the machines I used for the test have 4 cores, instead of 2.
I will now test on the VPS with only one core and see what happens!
Good news, as I was able to replicate your results on the VPS with only a single core:
I was not able to run the full 1E8 iterations (but instead ran half that), because I did not dimension enough RAM for the VPS when I set it up.
However, the test did solve the "weird" riddle, as now we know that the number of cores severely affects the results. For 2 cores or less, it seems that Integer arithmetic is much faster, but on a 4 core the floating point is faster (but not by much). The number of cores alone may not be the true reason, but maybe another factor is the cause, but it is an indication of the "weird" results.
So, for those running EAs on VPS's that use less resources (cores) to save on the cost of a VPS, Integer arithmetic can offer an advantage! On 4 cores the floating point is faster but not by a great deal, so if considering a general approach, Integer arithmetic may still be advisable, depending on other factors such as the conversion overhead.
Users will have to test their EA implementations on a case-by-case method and see which is faster for them.
On a whole, the "old paradigm" may not be dead just yet, although it seems that it may be dying out as technology progresses! I will have to do more research and educate myself more on this subject!
EDIT: This also poses the question of whether EAs do in fact run on a single thread as documented or if there is in fact some multi-threaded functionality involved. It may in fact be happening at the hardware level, but unfortunately I don't have enough knowledge or experience with current CPU/FPU implementations to be able to comment on this!
EDIT2: It has come to my attention that these tests should also be carried out on AMD processors and that the results could be quite different too.