Keep the variables values after modify parameters or recompiling while expert is runing

 

Hello everybody ..


Please can somebody clarify the activity of variables (other than local variables) after Oninit function happens, such after modifying input parameters. Is there a way to keep the values stored in "standard" variables even after Oninit is called.


Thanks for your help

 
Volcanbleu:

Hello everybody ..


Please can somebody clarify the activity of variables (other than local variables) after Oninit function happens, such after modifying input parameters. Is there a way to keep the values stored in "standard" variables even after Oninit is called.


Thanks for your help

Your questions are not clear but…
Save inputs with set files
Save variables via files or terminal global variables 
Global space variables remain as assigned until you reassign them or restart
A restart will occur with a symbol or tf change or a recompile
Don’t recompile while running =  bad practice 

 
Paul Anscombe #:
Your questions are not clear but…
Save inputs with set files
Save variables via files or terminal global variables 
Global space variables remain as assigned until you reassign them or restart
A restart will occur with a symbol or tf change or a recompile
Don’t recompile while running =  bad practice 

Thanks for reply. Yes of course when you recompile all variables are reset to their initialization.

But otherwise, any intervention on the parametre dialogue (modification of parameters or not), the values of global variables should not be affected.

Right?

 
I think he means how can the standard indicators reproduce the last used input parameters but the custom indicators are initialized with the ones you inserted in the code, and how to get them to behave like the standard indicators in that regard.
 
Volcanbleu #:

Thanks for reply. Yes of course when you recompile all variables are reset to their initialization.

But otherwise, any intervention on the parametre dialogue (modification of parameters or not), the values of global variables should not be affected.

Right?

If you had tried it you would already have your answer. 

Inputs are static parameters and cannot be altered inside the EA/Indicator. 

So the EA/Indicator restarts if parameters are altered, how else would a user selection get picked up.

 
Paul Anscombe #:

If you had tried it you would already have your answer. 

Inputs are static parameters and cannot be altered inside the EA/Indicator. 

So the EA/Indicator restarts if parameters are altered, how else would a user selection get picked up.

Hi Paul, thanks for your help.


Yes, I have already tried it, but sometimes there are some subtilities you dont get in begining, that's why I ask the comunity to have a full confirmation. Sorry if I take too much of your time and attention..

Besides, I am still confused with the different variables, specially with the "static" definition vs just define a standard global variable (like double x; for example)