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

 
Thanks, I'll test it tomorrow.
 
Great, in mql5 they removed sorting direction from ArraySort function, in the article about migration from mql4 they advise to use ArraySetAsSeries instead... But it doesn't work with multidimensional arrays =))) Yesterday I modeled ArraySort from nothing to do)))
 
Dmitry Fedoseev:

I choose the conversion to string option.

tweaked your option slightly

int ds(double v){
   string s=(string)v;
   int l=StringLen(s);
   int p=StringFind(s,".",0);
   return((p>0)?l-p-1:0);
}
 
Igor Makanu:

Thanks, I've got it, I'll test it tomorrow.

Forgot an important clarification there :)

#define    test(M,S,EX)        {uint mss=GetTickCount();int nn=(int)pow(10,M);for(int tst=0;tst<nn&&!_StopFlag;tst++){EX;} \
                                printf("%s: loops=%i ms=%u",S,nn,GetTickCount()-mss);}

Otherwise you can hang for a long time if you fail)

Taras Slobodyanik:

Tweaked your version a bit.

Option excellent, but it works 10 times slower than those already proposed below

 
fxsaber:

Can I brainstorm on a fast implementation of translating an array of structures (length multiple of sizeof(int)) to and from an int[] array?

Practical application is fast data exchange via resources. My variant is too universal, so it slows down.


These functions appeared in MT5

They do not exist in MT4 and probably will not. Therefore, we have to solve the problem with and without these functions (if they are useful).

The result will be useful to a large number of forum users here.


I have written a very simple template for brainstorming with my solution to this problem.


Result

The structure is a string. Its length cannot be a multiple of int or not int.

 
Ilya Malev:
It's great, mql5 has removed sorting direction from ArraySort function. It seems that in the article about migration from mql4 they recommend to use ArraySetAsSeries instead... But it doesn't work with multidimensional arrays =))) Yesterday I modeled ArraySort from nothing to do)))

Articles

Sorting methods and their visualization using MQL5

Dmitrii Troshin, 2017.05.26 09:44

Special library Graphic.mqh has been created for working with graphics in MQL5. The article describes an example of its practical use and explains the essence of marshalling. For each sorting, there is at least a separate article, and whole studies have been published on some of them, so only the general idea is described here.

 
Andrey Khatimlianskii:

Is there a comparison of sorting speed with the usual built-in ArraySort on random sampling? Is there any method that sorts random data faster on average...

Or not faster, but at least the same. Or not as fast, but at least not longer than twice as long. Without any Dll and other stuff like multithreading
 
Алексей Тарабанов:

The structure is a string. Its length cannot be a multiple of int, or not int.

The multiplicity is the condition of the problem.

 
I can't get past it.
I'll be sure to participate when I get to the computer.
After a quick look, I already have ideas on how to improve the result by 10-20%.

 
Nikolai Semko:
I can't get past it.
I'll be sure to participate when I get to the computer.
Already have some ideas on how to improve the result by 10-20%.

The result of what?

Reason: