Possible to retain previous input on new indicator load?

 

Hello. When loading default mt4 indicators on chart the input screen retains previous settings. i.e. I load a moving average on my chart and I chose blue color as input, now if I load a new moving average the input color is blue by default. 

Is it possible to have the same with custom made indicator? Please don't say to load template because at that point it would be the same as manually input the values. I have an indicator which I load several times a day and I would like to retain previous input on new load. 


Thank's. 

 
ArabiaSaudita20: I would like to retain previous input on new load. 

Save the changes in persistent storage (GV+flush or files)

 
William Roeder #:

Save the changes in persistent storage (GV+flush or files)

Thank's, unfortunately it's not very clear to me how to implement the thing. I also searched for examples but found anything, could you perhaps point me to some examples?

Thank you

 
ArabiaSaudita20 #:

Thank's, unfortunately it's not very clear to me how to implement the thing. I also searched for examples but found anything, could you perhaps point me to some examples?

Thank you

I have a script that require a datetime as input, I would like to have the datetime stored of the previous load of the script. Example:

I drag the script on the chart, set datetime input with calendar on 10 march 2024 (default value is 01 jan 2024). Script executes and deletes iteself from chart. 

I drag again the script on the chart and the input is still the default one (01 jan 2024), this second time I would like to have the previous input already typed in. 

Here's what I tried following William hint:

extern datetime navigate_to = GlobalVariableCheck(navigate) ? GlobalVariableGet(navigate) : D'2024.01.01 00:00:00';

Obviously this does not work...

Any suggestions? Thank's

 
You can't change the default value of an input/extern. Only the local/global variables.
extern datetime navigate_to =                                                                   D'2024.01.01 00:00:00';
       datetime navigate_actual = GlobalVariableCheck(navigate) ? GlobalVariableGet(navigate) : navigate_to;
 
William Roeder #:
You can't change the default value of an input/extern. Only the local/global variables.

Isn't there a way to have the value from previous load of the script inserted into the input screen on a new load of it?

 

Anyone?

 
ArabiaSaudita20 #:

Isn't there a way to have the value from previous load of the script inserted into the input screen on a new load of it?

no.

inputs are constants and cannot be changed.  deal with your problem via the methods already said above.