Get the number of decimal places of any numbers (not just quotes) bypassing Digits() in MQL4 and MQL5 - page 15

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
if ArrayCopy() is done in the same way as Cysh memmove(),
I think the speed of ArrayCopy() depends on the speed of memory allocation, if the intermediate buffer memory is ready for copying, ArrayCopy() will be executed very quickly, if the memory is not allocated, you will start requests to the operating system to allocate memory
you can try to test it - make one call to ArrayCopy() with a large data volume, thereby preparing the buffer memory for swapping, and then make a loop with ArrayCopy() with smaller data volume to be copied and then measure the speed
In our current example, copying is executed in a static array, but in general it is interesting, of course, when ArrayCopy is slower than a simple for. If you need to allocate memory, you'll have to do it anyway, no matter how you do it.
In our current example, copying is performed to a static array, but in general it is interesting, of course, when ArrayCopy is slower than simple for. If we need to allocate memory, we'll have to do it anyway.
It doesn't matter static or dynamic, we don't know how ArrayCopy() is implemented, I just assumed that it's a "wrapper" over standard Cish functions, memmove() usually works via additional buffer... well, as usual, that's how it was written before, it's hard to tell how and which compiler works
SZY: I just don't know how to test the runtime in MQL ((( - I've tried it a couple of times, I think I've taken examples from help, the results are somehow very different, and I've ignored this question out of necessity - I don't test the performance, I usually look in the profiler, what and how is executed in time
I just do not know how to test the execution speed in MQL ((( - I tried it a couple of times, I think I took examples from the help, but the results were very different for some reason, and I gave up on this issue because I do not test the performance, I usually use the profiler to see how and what is executed in time
here is the easiest way, which I used above
here's the easiest way i used above
Thanks, got it, I'll test it tomorrow
Yes, this will work much faster (replaced for where possible by ArrayCopy, the rest is the same):
I told you, I wrote the first thing that came to mind without any tests))
This variant is no different from mine. Measurements (minimum time out of 10 tries) prove it.
You can see that variant with cycle is faster, because cycle of 60 /4 = 15 elements.
This variant is no different from mine.
Apparently yes, only the structure type and array type are arbitrary.
You can see that the loop variant is faster, because the loop of 60 /4 = 15 elements.
Strangely enough, I got faster than ArrayCopy with the same MqlTicks and int...
Strangely, I got faster than ArrayCopy with the same MqlTicks and int...
I'm running it in MT5x64.
Apparently, yes, but the structure type and array type are arbitrary.
I purposely avoided the common case to allow more people to participate.
So far
Running in MT5x64.
Purposely bypassed the general case so that more people could participate.
So far.
I guess your code is already faster :)
I have to add a lot of service code there to improve functionality of ArrayCopy (source start, dest start, count) and check parameters for correctness...
In general, you have so many cool works/libraries that it's strange that you ask and discuss the best solution on the forum :)
It's strange that you ask and discuss the best solution on the forum :)
I need one for the HistoryTicks library. Thank you for participating.