Expert advisor variable

 

Is there any way to store a variable value in expert advisor for further calculation?

Let say I have

int var = 0;
int start()
  {
       //Do some calculation with var
       //Now var has a value of 10
       //How can I store this value 10? Next time expert advisor run, var no longer 0, but it will be 10?
  }

or do I have to create a separate custom indicator to store the value?

 
Use Global Variables.
 
No. I tried that. The value go back to 0
 
Hmm. Ok there must be something wrong with the code. I tried global var in simple program and it does store the value. Thanks deysmacro
Reason: