Features of the mql5 language, subtleties and tricks - page 318
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
So, what happens at Print("Error in ", LOCATION)
Print("Error in ", LOCATION) is expanded to Print("Error in ", __FILE__ " : " STR(__LINE__))
STR(__LINE__) has no stringification operation, i.e. there is no #x in it's expansion, but there is an x , so it has to evaluate x and input the value of __LINE__ to ST2 for stringification. It expands to ST2(11) which in turn will stringify the number 11, since it is using #x
So, techniqually speaking:
Forum on trading, automated trading systems and testing trading strategies
Features of the mql5 language, subtleties and tricks
amrali, 2025.11.04 11:40
Solution: use a 2nd level macro (for indirection).
This was discussed before here and here.
Output:
If you press Stop during optimisation, the descriptors of interrupted passes remain open, because code execution is strictly interrupted, preventing the logic of closing descriptors - CloseHandle - from being executed.
Moreover, this situation may occur during debugging, when debug closure is in progress. In general, there are scenarios in which descriptors are not closed.
I searched for a long time on the Internet for ways to close descriptors. In particular, in the case of using File Mapping.
Found only a formulation of the same problem without an answer.
For example, if the process was interrupted before CloseHandle, such a function will always return true on the next runs.
Is it possible to somehow free memory/file in case of open handles hanging? Now the problem is solved only by reloading the process - Terminal.
Is it possible to free memory/file if open descriptors are hanging? Right now the problem is solved only by reloading the process - Terminal.
Conclusion:
Can an existing Handle be reused?
Is it possible to free memory/file if open descriptors are hanging? Now the problem is solved only by reloading the process - Terminal.
If you press Stop during optimisation, the descriptors of interrupted passes remain open
Handle command line utility from Sysinternals won't help?
If you need to use WinAPI, you can do UnmapViewOfFile and CloseHandle (both are required). I don't know in detail, I haven't analysed it.
The Handle command line utility from Sysinternals won't help?
You need to use WinAPI.
If you need to use WinAPI, you can do UnmapViewOfFile and CloseHandle (both are required). I don't know in detail, I haven't analysed it.
Here you can find more details.