Download MetaTrader 5

Global variable limitations

To add comments, please log in or register
Michael
718
Michael  

No problem with code or anything.  Just wondering here before I set off on an adventure (that will probably end in a horrific crash.  :)   )

Is there any hard and fast limitations on how many global variables that can be set? 

Keith Watford
Moderator
10566
Keith Watford  

I don't know of any limitations.

When discussing global variables, please make it clear whether you are referring to globally declared variables or Global Variables of the client terminal.

Michael
718
Michael  
GumRai:

I don't know of any limitations.

When discussing global variables, please make it clear whether you are referring to globally declared variables or Global Variables of the client terminal.

Good point.  Sorry.  I'm asking about the Global Variables of the client terminal.
Keith Watford
Moderator
10566
Keith Watford  

I ran this in a script

  for(int x=0; x<10000; x++)
     GlobalVariableSet("GV"+IntegerToString(x),x);
  GlobalVariablesFlush();
  Print("Total GVs=",GlobalVariablesTotal());

It quite surprised me that it took 20 seconds to run the script, quite slow really.

Anyway, I got to over 120,000 GVs

To add comments, please log in or register