Features of the mql5 language, subtleties and tricks - page 316
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
2025.10.29 08:53:45.911 393227-3143 (EURUSD,H1) X64 Regular UCHAR: 391609 : 2147483640
2025.10.29 08:53:46.198 393227-3143 (EURUSD,H1) X64 Regular UINT: 287708 : 2147483640
2025.10.29 08:53:46.487 393227-3143 (EURUSD,H1) X64 Regular UNION32: 288293 : 2147483640
2025.10.29 08:53:46.681 393227-3143 (EURUSD,H1) X64 Regular UNION64: 193904 : 2147483640
2025.10.29 08:53:46.928 393227-3143 (EURUSD,H1) X64 Regular ULONG: 246861 : 2147483640
2025.10.29 08:55:48.715 393227-3143 (EURUSD,H1) AVX UCHAR: 401309 : 2147483640
2025.10.29 08:55:49.005 393227-3143 (EURUSD,H1) AVX UINT: 290088 : 2147483640
2025.10.29 08:55:49.296 393227-3143 (EURUSD,H1) AVX UNION32: 290388 : 2147483640
2025.10.29 08:55:49.490 393227-3143 (EURUSD,H1) AVX UNION64: 194669 : 2147483640
2025.10.29 08:55:49.756 393227-3143 (EURUSD,H1) AVX ULONG: 265811 : 2147483640
Thanks for the code! I have a goal to reduce the impact of array index checking on correctness, which slows down a lot. It is clear that long-arrays require eight times less such checks than char-arrays.
Your UNION64 variant has shown a result two times better than uchar[]. Despite the fact that it uses a static array, the compiler has optimised work with it without index checks. For this it gets a big plus!
In reality, you want to work with sequential bytes universally. So I tried to make different variants. In the end, the fastest was this one.
But it turned out to be slower than uchar[]. I can't speed it up.
Your UNION64 variant has shown a result two times better than uchar[]. Despite the fact that it uses a static array, the compiler has optimised work with it without index checks. For this it gets a big plus!
But it turned out to be slower than uchar[]. I can't speed it up.
Array iterator using UNION64:
.
I've done such a thing almost one in the same way, only immediately as a template. Unfortunately, it works slowly, so it doesn't make sense.
If you make this line first in the mq5-file, the debug will start BEFORE the global initialisation starts.
But sometimes it can be very long and it is necessary to start the debug AFTER the global initialisation starts (before the first On-event - for example, OnInit).
Then this line should be written last in the mq5-file.
This is not a beginner's question about basic stuff.
Does anyone know how to programme on/off autoscrolling in the experts tab?
It's not a beginner's question about basic stuff.
Does anyone know how to programme on/off autoscrolling in the experts tab?
The only tab "Expert Advisors" that I found in the terminal is in the settings (called by Ctrl+O). But there is no autoscrolling there. What do you mean?
The Experts tab in the Tools (CTRL + T). Next, click inside the window --> Auto Scroll.
This tab has always been called "Expert Advisors Log" or "Expert Advisors Log". And the tab "Journal" following it has always been called "Terminal Log". I don't know if it is possible to influence the Expert Advisors' Journal programmatically - I have never had a need to do so. But at least it is clearer now. And that's bread.
I can suggest an alternative: instead of the information your code sends to this log, let it send it to a text document. It is not difficult. For example, instead of the same print, you could use a 1-time written subroutine that adds a line to the end of the text document. Kim once published such code for MT4. I'll have a look at it myself.
It may not be exactly what you need, but you can format and scroll the text document as you like. Still a solution, for lack of a better one.
I can suggest an alternative: instead of the information your code sends to this log, have it send it to a text document.
This is an interesting solution, and you can make it so that the file is cleared before a new entry.
But still, I would like to see the terminal, the chart and theExpert Advisors' log at once.
Interesting solution, and you could make it so that the file is cleared before a new entry.
But still, I would like to see the terminal, chart andExpert Advisor log at the same time.