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
Why? Do we have a separate topic for that?
Good idea ))))
We should start a topiccalled "Chickenshit... " )))))
Everyone thought the topic had been exhausted, but then ...
I redid the QuickSort sorting algorithm for an array of structures. The bottom line is that the straightforward application of a simple array sorting algorithm to sorting an array of structures leads to the "physical" movement of large amounts of data. To avoid this, I used an index table, in which all permutations are made. At the same time, I used other code optimizations. To keep the universality for different types, I used a macro wrapper from fxsaber.
As a result, sorting the MqlRates[30000] array by 8 fields took approximately 3600 ms instead of 14900 ms. That is an acceleration of more than 4x. I did not check the sorting results carefully, let it fall on beta testers.
Thanks: of course, fxsaber for the universal code.
UPD: If it's not obvious, access to the top structure in the sorted list: MqlRates first = Rates[ RatesIdx[0] ];