This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community

Simple question for MetaQuotes folks...


Back to topics list
avatar
18
Cubesteak 2006.08.25 01:59 
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
avatar
49
codersguru 2006.08.26 10:25 
static bool running = true;

.....

if (running)
{
your code
}

running = false;
avatar
18
Cubesteak 2006.08.26 23:44 
Brilliant. :) Thank you!

static bool running = true;

.....

if (running)
{
your code
}

running = false;
Back to topics list  
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets