is it possible for an EA to call a script?

 
any body knows that
is it possible for an EA to call a script?

and how?

Thanks!!
 
it is possible to create a library of common functions which can then be included into script and/or EA.
Examine <include> directive.
This is how it is done by the pros. Then you can change functionality without ever touching script or EA.
 
irusoh1 wrote:
it is possible to create a library of common functions which can then be included into script and/or EA.
Examine <include> directive.
This is how it is done by the pros. Then you can change functionality without ever touching script or EA.

thanks!

but my point is let an EA call a script to run once and only once, not tickwise. can it be done by using include?
 
it doesn't matter what it is, a script, a function, a library... If you don't put a condition on it, it will run every tick.
To run it once you have to call it in init() function, or else use a setup like this

bool firsttime;
 
 
int init()
{
firsttime=false;
 
...
 
}
 
int start()
{
 
  if(firsttime)
  {
    // run once routine
    firsttime=false;
  }
...
}
 
irusoh1 wrote:
it doesn't matter what it is, a script, a function, a library... If you don't put a condition on it, it will run every tick.
To run it once you have to call it in init() function, or else use a setup like this

do you mean this:

bool firsttime;
 
 
int init()
{
firsttime=false;
 
...
 
}
 
int start()
{
 
  if(!firsttime)
  {
    // run once routine
    firsttime=true;
  }
...
}
Thanks a lot!!
 

You can not call a script from an EA., Scripts have to be attached to a chart just like an EA., and you can have only one attached at a time. It is not a function that can be called.

You can re-write it as a function or a seperate module file and call it once or as meny times as you like within a IF( ) statement as irusoh1 has pointed out but it has to be re-writen as a function to be called from the EA..

Reason: