Features of the mql5 language, subtleties and tricks - page 222
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
This is nothing new, it's the way it's always worked from birth.
Only if the data is larger than __atomic__ should access be wrapped/protected with critical sections (or mutex to terminal std::thread)
Well I didn't know this behaviour, and was expecting a separate process when importing.
I thought that global DLL pointers will be new, in each loaded MT5 program.
With what I had to sweat to understand the logic, wondering why the error will pop up in memory.
But when I figured out the reason by try (print) method, then the whole architectural plan of working with DLL will be built differently.
Man, you're right about mutexes, I didn't think about it. Thanks for the tip.
Yes. Although if the method has no parameters, you can do so:
Application:
With partial execution of orders the fieldORDER_TIME_SETUP_MSC changes.
As a consequence, DEAL_TIME_MSC can be less than ORDER_TIME_SETUP_MSC of its order.
What about using a custom compare function:
You're right, thank you! I overdid it on a flat spot. I'll leave your variant for sorting.
Application.
ZZY It's a pity, by subfield or method, it doesn't work.
Here is the optimized QuickSort from my library, slightly adapted to your requirements.
It can sort huge arrays without stack overflow (due to uncontrolled recursion).
When using ArrayInsert, you can save on memory when Array_Destination[] is smaller than Array_Source[] from which elements are added.
To do this, you should apply ArraySwap twice: before and after ArrayInsert.
For example, this is relevant when working with large MqlTick archives, etc.
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
fxsaber, 2022.02.20 15:00
You are right, Thank you! I overmudryl on a straight place. I will leave your variant for sorting.
Application.
There was an error in the Partition method. Corrected version.
There was an error in the Partition method. Corrected version.
For a special case when a numeric field is taken for sorting (the most common situation), I wrote a variant that is several orders of magnitude faster than the previous one. But it consumes twice as much memory. It is relevant for large arrays.
Application (with measuring the execution time).
Result.
For a particular case when a numeric field is used for sorting (the most common situation), I wrote a variant that is several orders of magnitude faster than the previous one. But it consumes twice as much memory. It is relevant for large arrays.
Application (with measuring of execution time).
Result.
What do you think of this option?