External Variables

 

Hi all,

I have developed an EA that works rather well in backtest, and i wish to move forward to demo/forward test although before I do that I have what I hope is a quick and simple question.

My code makes use of external or global variables, by defining them outside (above) the int start() routine. These variables are 'reset' or changed each day and retain a specific value for the entire day based on some other parameters. If this is run on a live or demo server and for some reason connection to the server is lost for a short period, say a couple of minutes, but mt4 is not shutdown (say classic plug pull scenario).

Will this reset the EA? or will it still retain these external values until the ea is removed from the chart or mt4 is shutdown?

Thankyou for your response.

 

Global variables are retained forever, unless your EA remove them or you remove them manually.

 
Enforcer:
Global variables are retained forever, unless your EA remove them or you remove them manually.

Not entirely true as if none of your ea request them it will be auto deleted in about 4 weeks by Client Terminal next time it starts.

-Guyver

 
Global variables are kept in the client terminal within 4 weeks since the last access, then they will be deleted automatically. An access to a global variable is not only setting of a new value, but reading of the global variable value, as well.

Yup, but I saw in my MT4 globals from last year, since I installed platform... I doubt they was accessed by any EA... some bug maybe?

 
Enforcer:
Didn't look so deep on globals but I saw in my MT4 globals from last year, since I installed platform...

Well, the implementation of GV's are such it should be deleted in 4 weeks if no activity since it is stored in HD. In your case perhaps a problems occured re-locating after an MT4 update who knows.

-guyver

 

Well, official time to live is 4 weeks, but as I saw can be longer

 
Enforcer:
Well, official time to live is 4 weeks, but as I saw can be longer

lol ya lets celebrate that ..

 
Guyver:
lol ya lets celebrate that ..

If is really necessary... going to bring some chicks to dance a hula for global variables

 
Enforcer:
If is really necessary... going to bring some chicks to dance a hula for global variables

looooooooooooool..

 
euphoria:
Hi all,

I have developed an EA that works rather well in backtest, and i wish to move forward to demo/forward test although before I do that I have what I hope is a quick and simple question.

My code makes use of external or global variables, by defining them outside (above) the int start() routine. These variables are 'reset' or changed each day and retain a specific value for the entire day based on some other parameters. If this is run on a live or demo server and for some reason connection to the server is lost for a short period, say a couple of minutes, but mt4 is not shutdown (say classic plug pull scenario).

Will this reset the EA? or will it still retain these external values until the ea is removed from the chart or mt4 is shutdown?

Thankyou for your response.

Hi , hopefully you have got the answer you are looking for . ... Please ignore the after effects we are showing .. lool

 
Guyver:
Hi , hopefully you have got the answer you are looking for . ... Please ignore the after effects we are showing .. lool

Just ignore us, we are foolin' around

But...

I think this guy explain very clear what's about globlal variables

YouTube - marvellous hula dance / O KE AHI LONOMAKUA