View Single Post
  #6 (permalink)  
Old 11-27-2007, 01:25 AM
project1972's Avatar
project1972 project1972 is offline
Senior Member
 
Join Date: May 2006
Location: Fl, Usa
Posts: 277
project1972 is on a distinguished road
Quote:
Originally Posted by project1972 View Post
Use something like this.

string ok_trade;
int direction;

direction=GlobalVariableGet(ok_trade);

Also in the init section you shold set the global variable if it was not set by the indicator before the EA try to read it.

void init()
{
if (!GlobalVariableCheck(ok_trade)) GlobalVariableSet(ok_trade,0);
return(0);
}

and in the start function you can read it without errors

direction=GlobalVariableGet(ok_trade);
__________________
I have not failed. I've just found 10,000 ways that won't work.
Thomas Alva Edison
Reply With Quote