Hi MT4 programmers, users,
This thread is started to discuss ways to better control MT4 external variables than what the default MT4 methods provide. It is especially important for when a programmer only wants to provide .ex4 files, which means that the user cannot edit the source to change various default values.
Of course there is an ability to "Save" and "Load" a .set file at the time an indicator/script is added to a chart. However, the use of .set files is not automatic, and so it's a bit of a nuisance to always remember to "Load". Furthermore, suppose one has already added an indicator to many charts, but then wants to make a change that applies to ALL existing charts. A .set file does not accomplish this.
What does?
Well, the very generous FF contributor "hanover" has supplied a number of free MT4 programs, and he has established his own (private code) methods for the user to create a "Presets---Indicator Name.TXT" file, which goes into the C:/.../experts/files/ folder.
His programs have regular external variables of course. Consider for example his Recent News (v3) indicator. One variable is "ParameterFile = 'TXT'" (NONE is the default, but 'TXT' (or blank) is the value to look for the "Presets---Recent News.TXT" file).
If that file is found, it is parsed for legal variable names and values. THESE PRESET VALUES SUPERCEDE the values of his external variables in the "Inputs" section! (It works well, but one drawback is you do NOT see the actual value that is used, because the .ex4 has only the compiled value which it displays. The init() section finds the Presets and replaces the default value with an override).
Recently I posted some complimentary comments to Hanover (David) about his Presets-use-model, and CockeyedCowboy picked up on the discussion with some great ideas of his own (see post), and suggested I open a new thread to continue discussion... so here it is!
CockeyedCowboy (Keit), and others, please join in.
Kent (pips4life)
This thread is started to discuss ways to better control MT4 external variables than what the default MT4 methods provide. It is especially important for when a programmer only wants to provide .ex4 files, which means that the user cannot edit the source to change various default values.
Of course there is an ability to "Save" and "Load" a .set file at the time an indicator/script is added to a chart. However, the use of .set files is not automatic, and so it's a bit of a nuisance to always remember to "Load". Furthermore, suppose one has already added an indicator to many charts, but then wants to make a change that applies to ALL existing charts. A .set file does not accomplish this.
What does?
Well, the very generous FF contributor "hanover" has supplied a number of free MT4 programs, and he has established his own (private code) methods for the user to create a "Presets---Indicator Name.TXT" file, which goes into the C:/.../experts/files/ folder.
His programs have regular external variables of course. Consider for example his Recent News (v3) indicator. One variable is "ParameterFile = 'TXT'" (NONE is the default, but 'TXT' (or blank) is the value to look for the "Presets---Recent News.TXT" file).
If that file is found, it is parsed for legal variable names and values. THESE PRESET VALUES SUPERCEDE the values of his external variables in the "Inputs" section! (It works well, but one drawback is you do NOT see the actual value that is used, because the .ex4 has only the compiled value which it displays. The init() section finds the Presets and replaces the default value with an override).
Recently I posted some complimentary comments to Hanover (David) about his Presets-use-model, and CockeyedCowboy picked up on the discussion with some great ideas of his own (see post), and suggested I open a new thread to continue discussion... so here it is!
CockeyedCowboy (Keit), and others, please join in.
Kent (pips4life)