Is there a way to keep the users inputs for the next execution of a script?
Let's say a script has a parameter called GMT_offset with the default set to 1.
extern int GMT_offset = 1;
The user changes it to 2, but the next time he runs the script the default will be 1 again, even though it's far likelier that he will want to use 2 again. Is there any way to keep his settings so that next time the default is 2?
I know how to store his settings in Global Variables, which could be read next time, but I don't know how to assign this as default values to the input parameters, if this at all is possible.
(please don't reply that GMT_offset can be calculated in MQL4, that was just an example)
Thanks
Gosta
- how to set the indicator's input parameter from an Expert Adviser
- Errors, bugs, questions
- [WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you.
gostahulden:
The only way to change the default value is to change the source and recompile the script (or hack the compiled file...). Storing the last used value in a GV, file or any other method will not change the default value shown in the Properties Window (F7) cause of a well known MT4 'bug' - changes made to extern param values programmatically are not reflected in the Properties Windows.
Is there a way to keep the users inputs for the next execution of a script?
Let's say a script has a parameter called GMT_offset with the default set to 1.
extern int GMT_offset = 1;
The user changes it to 2, but the next time he runs the script the default will be 1 again, even though it's far likelier that he will want to use 2 again. Is there any way to keep his settings so that next time the default is 2?
I know how to store his settings in Global Variables, which could be read next time, but I don't know how to assign this as default values to the input parameters, if this at all is possible.

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