I know, that in some cases non-buffered variables are lost. for example
static int MyVariable =0; ...... MyVariable = (Condition ? MyVariable+1 : MyVariable ); ......
but in some cases i found (when something changed on chart or input or etc… without refreshing the chart F5 ), the value of that variable is nulled.
I was advised to use buffers for such variables:
MyVariable[i] = (Condition ? MyVariable[i+1] +1 : MyVariable[i+1] );
however i have tens of such repeated variables in my indicators/scripts, and i cant set buffers for those variables… is any other solution? for example, what if i use array, will it be nulled too?
static int MyAr; .... MyAr= (Condition ? MyAr+1 : MyAr); ....