saved file or global variable?

 

gidday. I have my ea that I normally only trade 1 or 2 pairs, BUT I want to use it on more pairs now. This function which determines its trail stop and stop loss depending on a bool; true or false function like so...

bool margo()
  {
   if(equ<0.85*bal)
      return false;
   if(info.Margin()/equ*100>=25)
      return false;
   if(info.FreeMargin()!=equ && info.MarginLevel()<=lever && info.MarginLevel()>=0.01)
      return false;
   MqlDateTime structTime;
   datetime time[];
   CopyTime(NULL,PERIOD_CURRENT,0,3,time);
   TimeToStruct(time[1],structTime);
   if(structTime.day_of_week==FRIDAY)
      return false;
   return true;
  }

When the function returns true the trail stop settings are wider apart, while when it returns false, trail stop settings are much smaller.

Since that this function will result in the same result from 1 ea to the next -- it seems to me that it could be benefital to have 1 of my eas become the manager that runs this function, while the other eas retrieve the result from either a gv or saved file.

All advice will be appreciated and considered. Considering that I am more than a newbie, but not a paid coding professional: what do you suggest that I do to limit this function to a single ea? NOTE I know how to limit the function to 1 ea and have the others retireve the result; I just do not have any reason to use a gv rather than save the result in a saved file.

RT.

 
Revo Trades:

gidday. I have my ea that I normally only trade 1 or 2 pairs, BUT I want to use it on more pairs now. This function which determines its trail stop and stop loss depending on a bool; true or false function like so...

When the function returns true the trail stop settings are wider apart, while when it returns false, trail stop settings are much smaller.

Since that this function will result in the same result from 1 ea to the next -- it seems to me that it could be benefital to have 1 of my eas become the manager that runs this function, while the other eas retrieve the result from either a gv or saved file.

All advice will be appreciated and considered. Considering that I am more than a newbie, but not a paid coding professional: what do you suggest that I do to limit this function to a single ea? NOTE I know how to limit the function to 1 ea and have the others retireve the result; I just do not have any reason to use a gv rather than save the result in a saved file.

RT.

 through resources