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
Unlike MT4, MT5 does not log the input parameters of Expert Advisors when they are launched or changed. Therefore, it is impossible to determine from the log what was launched in the Terminal.
A similar function can correct this situation.
Application
Result
Unfortunately, it doesn't work for scripts. MT4 outputs input parameters of scripts by itself, MT5 does not.
I cannot run an EA that uses DLLs using this library. In the logs DLL loading is not allowed. Is there anything that can be done about it?
It's working.
Something I have an apprehension about is the principle of using a constant as the name of a temporary template in a string:
contains a potential bug related to multithreading. If one and the same programme running on different charts tries to use the library, there may be a collision with the template file - either an access error or two identical copies of the template will be quietly launched, although different ones were used.
You should generate a temporary name, preferably of the form (it was __FILE__, "strike" doesn't work in html here) MQL-program-name + timestamp + random.
It is also desirable to delete former files automatically by timeout at any next call, for example, in 1 day (by analysing part of timestamp), so that they don't litter folders.
PS. The case is even worse, because __FILE__ is a source file and is always equal to Expert.mqh - in all programmes using it! Corrected the sentence by name.This was done consciously, weighing all the pros and cons.
It makes sense to delete immediately after creating a template, not once a day. However, it is convenient to always have the last saved template to better analyse what is happening.
It was done deliberately, weighing up the pros and cons.
It makes sense to delete immediately after creating a template, not once a day. However, it is convenient to always have the last saved template to better analyse what is happening.
I can't cite any pros for the current method. IMHO, I suggested a more correct one.
It makes sense to delete at once if Sync = true (which is the default), but it is not implemented that way now - the file remains.
I can't think of a single "pro" for the current method. IMHO, suggested a more correct one.
The pros are practical application. I launched Terminal with previously launched Expert Advisors, which at the start immediately went into their templates. They worked perfectly. I am sure that it is possible to reproduce the theoretical collision. But it is far from practice in my case. If you decide to create a universal solution, share it here. I'll update the bible. I'm not ready to do it myself.
It makes sense to delete at once if Sync = true (which is the default), but it is not implemented that way now - the file remains.
Yes, I don't delete it on purpose.
For - this is a practical application. I launched Terminal with previously launched Expert Advisors, which at the start immediately went into their templates. They worked perfectly. I am sure that it is possible to reproduce the theoretical collision. But it is far from practice in my case. If you decide to create a universal solution, share it here. I'll update the bible. I'm not ready to do it myself.
Yeah, I'm not deleting it on purpose.
I still don't understand why the constant name Expert.mqh.tpl is more "practical" (practical?) than templates named after the programme that generates them? Let's say there is a programme A.mq5 and B.mq5 that use bibla. If they generated templates with their own names it would be more practical, firstly, to have the last "fingerprint" of actions of _each_ programme, instead of overwriting one by the other. Secondly, you could immediately see who the generator is by name (especially useful if the programmes are foreign). Now you can't tell that from the Expert.mqh.tpl file until you get inside. The universal solution I have given is to take the name of the MQL-programme+timestamp+random. And I don't see the need to leave the file at sync=true. I think everything has been tested and debugged long ago. In case of errors and the need for debugging, there is an option sync=false. Then the file should be left. I think everything is logical. And the edits are simple.
I agree that in practice the collision may occur rarely, unless someone will use the biblio in parallel in several programmes. I don't have it, but I just had a quick look in the code, and my eye was caught by Expert.mqh.tpl in the Files folder. Everything is purely imho.