Expert stopped

 
Hi MT supporto , hi guys

Yesterday I had a problem with my expert advisor that was stopped becouse a function is not found in my libraris

There is a mode to excute an alert if the expert was stopped automatically ?

genio
 
You might try IsStopped() function
 
I tried the IsStopped() function but not resolve my problem.

I inserted the IsStopped function after the istruction that stop the expert but it isn't excuted


this is the demo code that I have write for test this problem

//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
if ( IsStopped() )
Alert("expert stopped before");
int a = lastBarTime( 1 );
if ( IsStopped() )
Alert("expert stopped after");
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
if ( IsStopped() )
Alert("expert stopped in deinit");
}

genio
 
Hmm...

Maybe put

start(){
Print("Expert Started");

To see if it runs at all ... ???

If library function is not found, does the expert even start?
 
Hi phy

example:

start()
{
a = 5;
b = 10;
etc another istruction..........

if ( c == 20 )
myFunction( parametres ); // this function not found and stop the expert when the myFunction is called

if ( IsStopped() )
Alert(" the expert advisor was stopped");
}

the new quote arrives and the start function run but we suppose that for the first 5 quote the if ( c== 20 ) condition is false. when the six quote arrives , the if ( c == 20 ) condition will be true and myFunction is called and the expert advisor is stopped because the myFunction is not found

Now I want to receive an alert.
The problem is that the code is not read after the expert is stopped

On help of metaeditor there is writen that the code continue to read for another 2.5 second after the expert stopped but this is false else the istruction if ( IsStopped() ) Alert(".......") that follow the if ( c == 20 ) condition where the expert is stopped will be run.

I hope that my example is clear

genio
 
This may be more "crash" than stop... I don't know... Need expert answer...
 
... for example...

Put a zero divide in your code, and it just stops dead.

int start(){

Print("Start");
int i = 0;
int j = 1/i;
Print("Bueller? Anyone? ");

}