Terminating an Expert

To add comments, please log in or register
IN BHM
57
IN BHM  
How can you make an expert end from within it own code?
Ralph Ronnquist
99
Ralph Ronnquist  
Divide by zero ? .. doesn't detach it from the chart, though.
Glaswegian
485
Glaswegian  
inbhm:
How can you make an expert end from within it own code?
There is no way to do so I'm afraid.
You can stop it working though.
bool Stop;
 
int init()
{
    Stop = false;
}
 
int start()
{
    if (Stop)
        return (0);
 
// EA code here
 
// if something happens that has to stop the EA...
    Stop = true;
    return (0);
 
}
Semion Tremsin
2335
Semion Tremsin  
You might want to put the Stop in a globalvar, cause the thing that stopped the ea might change in the next execution or something...and it could start up again. .
To add comments, please log in or register