a) which reads faster.
This
for(int i = 0; i <12; ++i) worsTics[i] = 0;
will most likely be optimized by the compiler
b) again: which reads faster.
I think it wouldn't be logical if equivalent entries were calculated at different speeds
double true_range = (High==Low)?0:(Close-Open)/(High-Low);This entry is equivalent to the following:
double true_range; if(High==Low)true_range=0; // if High and Low are equal else true_range=(Close-Open)/(High-Low); // if the range is not null
a) which reads faster.
Even if we imagine that the loop would run a little slower (although I think it wouldn't). It's better to use a loop anyway. Would you agree to make your code unusable for edits and maintenance in order to save half a nanosecond of CPU time (with this approach, your code will definitely become one-time only)? It's cheaper to upgrade hardware than to spend a huge amount of time trying to make changes to one-time code.
In addition, such calculations are usually performed during initialization, and ready-made values are used during operation.
thanks for the reminder. I will see about decreasing the frequency that the aforementioned are used, rather than be further concerned with the specific lines.
Even if we imagine that the loop would run a little slower (although I think it wouldn't). It's better to use a loop anyway. Would you agree to make your code unusable for edits and maintenance in order to save half a nanosecond of CPU time (with this approach, your code will definitely become one-time only)? It's cheaper to upgrade hardware than to spend a huge amount of time trying to make changes to one-time code.
In addition, such calculations are usually performed during initialization, and ready-made values are used during operation.
totally agree. thanks.
Which is faster - Floating-Point or Integer arithmetic? - Expert Advisors and Automated Trading - MQL5 programming forum - Page 11
Do not assume. Always test. Sometimes you get surprised.
Which is faster - Floating-Point or Integer arithmetic? - Expert Advisors and Automated Trading - MQL5 programming forum - Page 11
interesting; to say the least. I am curious about the lines i demonstrated above, if either case is faster than the other, but am not desperate enough to spend time to carry out the test. I was hoping that one of the mql gods had done such a test before today. (hint hint). Thanks for the link.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
2 questions, just as much curiosity as anything else.
a) which reads faster.
b) again: which reads faster.