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
nicholishen: Alain, not sure how you got those results... I'm right where Fernando is on a 2.4 GHz i5.
Fernando, thanks for also running these on MT4...that answers that for me...
Surprisingly, array read/write/sort performance is the same as well. That's where I thought <int> might have a more significant edge.Fernando, I hope you don't mind me bowing out of this for now. I've already committed way too much time to this, and I'm convince that the optimization is to avoid casting whenever possible and use whatever data-type makes sense. Good luck!
Thank you for your cooperation and contributions, and for opening our eyes about our assumptions on integer arithmetic being always faster. The current reality is that with modern CPU's this is actually a very "grey" area that depends on many factors!
In my own EAs I still plan to continue using Integer based arithmetic, mainly because of the tick-size and lot-step alignment, but I will from now on always double check the performance impact of that decision.
Again, thank you!
Thank you for your cooperation and contributions, and for opening our eyes about our assumptions on integer arithmetic being always faster. The current reality is that with modern CPU's this is actually a very "grey" area that depends on many factors!
In my own EAs I still plan to continue using Integer based arithmetic, mainly because of the tick-size and lot-step alignment, but I will from now on always double check the performance impact of that decision.
Again, thank you!
Just keep in mind that for most applications you only ever really need to round to tick and lot-step when it comes time to send an order, however, with the int method you have to round the incoming tick data and indicator data (assuming you use indicators) . There will be 1000's of ticks for each order placed. That's a lot of extra overhead.
Yes I am well aware of that, but no, I don't use Indicators in the normal sense, because I always re-code their functionality into the EA because of the self-optimisation routines and the Virtual/Simulated Order systems I implement.
I have already run several tests on them, and there is no extra overhead (or just negligibly) in the sense you describe. In all my cases (except for two EAs), my Integer implementation is still faster than the floating-point alternative and hence why I was adamant about it in our discussions.
I do however, now recognise that it is not a "universal" rule and that it depends on many factors and that for other implementations, floating-point could well be much faster than Integer.
Yes I am well aware of that, but no, I don't use Indicators in the normal sense, because I always re-code their functionality into the EA because of the self-optimisation routines and the Virtual/Simulated Order systems I implement.
I have already run several tests on them, and there is no extra overhead (or just negligibly) in the sense you describe. In all my cases (except for two EAs), my Integer implementation is still faster than the floating-point alternative and hence why I was adamant about it in our discussions.
I do however, now recognise that it is not a "universal" rule and that it depends on many factors and that for other implementations, floating-point could well be much faster than Integer.
Please lets not start getting "heated" about this again. I have already explained that I code for both MT4 and MT5 (simultaneously) and that most of my EAs use self-optimisation and not necessarily pre-optimisation via the Strategy Tester, be that on MT4 or MT5, and in my cases I still benefit form using the "ints".
Please lets not start getting "heated" about this again. I have already explained that I code for both MT4 and MT5 (simultaneously) and that most of my EAs use self-optimisation and not necessarily pre-optimisation via the Strategy Tester, be that on MT4 or MT5, and in my cases I still benefit form using the "ints".
Alain, not sure how you got those results... I'm right where Fernando is on a 2.4 GHz i5.
I just ran the script. I know the results are "weird" and that's well why we got these big misunderstanding yesterday.
Just once again :
2018.01.16 09:54:43.599 224626_2 (NZDUSD,H1) <int>: 41 ms for 10000000 iterations
2018.01.16 09:54:43.599 224626_2 (NZDUSD,H1) result = 9981401 sum=327635664846
2018.01.16 09:54:43.640 224626_2 (NZDUSD,H1) <double>: 40 ms for 10000000 iterations
2018.01.16 09:54:43.640 224626_2 (NZDUSD,H1) result = 9981401 sum=327635664846.000000
2018.01.16 09:47:47.153 224626_2 (NZDUSD,H1) <int>: 4175 ms for 100000000 iterations
2018.01.16 09:47:47.155 224626_2 (NZDUSD,H1) result = 99813994 sum=3276804185274
2018.01.16 09:47:55.396 224626_2 (NZDUSD,H1) <double>: 8233 ms for 100000000 iterations
2018.01.16 09:47:55.415 224626_2 (NZDUSD,H1) result = 99813994 sum=3276804185274.000000
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.