No, there is no MQL programmatic way to load/save preset ".set" files.
Here are some options I have considered before:
- Reading from Global Terminal Variables during the OnInit() event handling, thus ignoring the inputs in favour of previously stored values. When no variables are found, one can then write the inputs to Global Terminal Variables for subsequent use. This method can also be used for on-the-fly updates to functionality, by regularly monitoring the Global Terminal Variables during OnTick() or OnTimer() events. This is the method I use the most, because the MetaTrader terminal offers a simple GUI to create, edit and delete Global Terminal Variables.
- Another option is to read the inputs from a previously saved file (local or common area). Here too, one can save the inputs if the file is not found, and also monitor for updates during OnTick() or OnTimer() events. This may be the better method for your "Git" approach.
- Instead of files, one could also use an SQLite database for storing/retrieving inputs.
- Yet another option I have seen been used, is to remotely obtain inputs from an external source via WebRequest() or Socket connections.
- There might be other options and ideas that I have not considered.
Documentation on MQL5: Global Variables of the Terminal
- www.mql5.com
There is a group set of functions for working with global variables. Global variables of the client terminal should not be mixed up with variables...
Thank you Fernando. Options 1 and 2 are great solutions. Indeed, I can modify my EA code to read inputs from external files instead of relying on .set files. This approach will work perfectly with my deployment workflow.
I appreciate the guidance!
François Bernard #:
Thank you Fernando. Options 1 and 2 are great solutions. Indeed, I can modify my EA code to read inputs from external files instead of relying on .set files. This approach will work perfectly with my deployment workflow.
I appreciate the guidance!
Look at the Expert library.
Expert
- 2017.11.03
- www.mql5.com
A library for reading/writing the parameters of arbitrary Expert Advisors.
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
Hi,
I have a technical question regarding automated preset management for Expert Advisors in production environments.
I wonder if it is possible to programmatically load .set preset files into already-running Expert Advisors using MQL5 code? or can MQL5 scripts automatically attach Expert Advisors to charts and apply preset configurations without requiring manual user interaction?
I used to deploy trading systems on remote Linux servers using automated Git repository updates. My objective is to implement a 24-hour automated preset refresh cycle, where updated preset files can be applied to running Expert Advisors without manual
intervention. My current workflow: Local Development → Git Repository → Remote Server → MT5 Terminal
The missing piece is the automated application of updated presets to active Expert Advisors.
I understand MT5 has security restrictions around automated EA deployment, but I wanted to confirm if there are any official methods or workarounds for preset updates in production environments.
Any guidance or clarification would be greatly appreciated.
Thank you,
François