Simple question for MetaQuotes folks...

 
Hello,

What is the proper way to exit from a running EA programatically?

I've tried returning various values in Start(), like return(-1), return(1), etc and I've tried calling Deinit(), but neither seem to work.

I want the EA to exit on certain conditions...

Thanks,
Cubesteak
 
static bool running = true;

.....

if (running)
{
your code
}

running = false;
 
Brilliant. :) Thank you!

static bool running = true;

.....

if (running)
{
your code
}

running = false;