Download MetaTrader 5
To add comments, please log in or register
Interested in the Market activity? Come and track!
Minh
140
Minh 2014.05.01 17:06 

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?

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.05.01 17:14  
Use Global Variables.
Minh
140
Minh 2014.05.01 17:23  
No. I tried that. The value go back to 0
Minh
140
Minh 2014.05.01 17:30  
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
/
To add comments, please log in or register